diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 16468ff9f..18a6dc790 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -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;