Commit a010825
committed
Address review comments on Fenrir zeroization fixes
Two follow-ups raised by Copilot review on PR #10247:
src/pk_rsa.c: Make derAllocSz a word32 instead of int and only assign
it after a successful XMALLOC, so the cleanup path can never call
ForceZero with a wrapped-around size derived from a negative derSz.
src/pk.c: Capture allocSz at the XMALLOC call site (and clear it back
to 0 on allocation failure) so the relationship between the buffer
allocation and the recorded size is explicit and cannot drift if the
surrounding control flow changes.1 parent 1e04092 commit a010825
2 files changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7150 | 7150 | | |
7151 | 7151 | | |
7152 | 7152 | | |
| 7153 | + | |
7153 | 7154 | | |
7154 | | - | |
| 7155 | + | |
7155 | 7156 | | |
| 7157 | + | |
7156 | 7158 | | |
7157 | 7159 | | |
7158 | 7160 | | |
7159 | | - | |
7160 | | - | |
7161 | | - | |
7162 | | - | |
7163 | 7161 | | |
7164 | 7162 | | |
7165 | 7163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
| 785 | + | |
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
828 | 827 | | |
829 | 828 | | |
830 | 829 | | |
| |||
835 | 834 | | |
836 | 835 | | |
837 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
838 | 840 | | |
839 | 841 | | |
840 | 842 | | |
| |||
868 | 870 | | |
869 | 871 | | |
870 | 872 | | |
871 | | - | |
872 | | - | |
| 873 | + | |
| 874 | + | |
873 | 875 | | |
874 | 876 | | |
875 | 877 | | |
| |||
0 commit comments