diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index a4fc5f6ca..b2eafb4cc 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -5229,9 +5229,11 @@ int mp_read_radix (mp_int * a, const char *str, int radix) */ if (y < radix) { if ((res = mp_mul_d (a, (mp_digit) radix, a)) != MP_OKAY) { + mp_zero(a); return res; } if ((res = mp_add_d (a, (mp_digit) y, a)) != MP_OKAY) { + mp_zero(a); return res; } } else {