Fix OOB in fp_read_radix_16

pull/3180/head
Eric Blankenhorn 2020-07-31 15:19:40 -05:00
parent ff08a01f94
commit d21d95c629
1 changed files with 3 additions and 0 deletions

View File

@ -4802,6 +4802,9 @@ static int fp_read_radix_16(fp_int *a, const char *str)
else
return FP_VAL;
if (k >= FP_SIZE)
return FP_VAL;
a->dp[k] |= ((fp_digit)ch) << j;
j += 4;
k += j == DIGIT_BIT;