mirror of
https://github.com/cryb-to/cryb-to.git
synced 2025-01-29 07:01:10 +00:00
Fix off-by-one bug in mpi_cmp() which could cause it to read past the
end of the buffer.
This commit is contained in:
parent
43b870dc83
commit
1c024928f9
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ mpi_cmp_abs(cryb_mpi *X, cryb_mpi *Y)
|
|||
if (X->msb < Y->msb)
|
||||
return (-1);
|
||||
/* no luck, compare word by word */
|
||||
for (i = (X->msb + 31) / 32; i >= 0; --i) {
|
||||
for (i = X->msb / 32; i >= 0; --i) {
|
||||
if (X->words[i] > Y->words[i])
|
||||
return (1);
|
||||
if (X->words[i] < Y->words[i])
|
||||
|
|
Loading…
Reference in a new issue