TFM: fix big endian reading a zero length buffer

Bail early as big endian implementation doesn't handle it.
This commit is contained in:
Sean Parkinson
2023-06-14 08:05:57 +10:00
parent 82cc988226
commit e17f86d145

View File

@ -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);