diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 1ab156a24..99be4217e 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -3697,6 +3697,10 @@ int fp_read_unsigned_bin(fp_int *a, const unsigned char *b, int c) /* zero the int */ fp_zero (a); + if (c == 0) { + return FP_OKAY; + } + /* if input b excess max, then truncate */ if (c > 0 && (word32)c > maxC) { int excess = (c - maxC);