forked from wolfSSL/wolfssl
tfm and integer: skip whitespace at end in radix read
This commit is contained in:
@ -5358,6 +5358,9 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
|
|||||||
++str;
|
++str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Skip whitespace at end of str */
|
||||||
|
while (CharIsWhiteSpace(*str))
|
||||||
|
++str;
|
||||||
/* if digit in isn't null term, then invalid character was found */
|
/* if digit in isn't null term, then invalid character was found */
|
||||||
if (*str != '\0') {
|
if (*str != '\0') {
|
||||||
mp_zero (a);
|
mp_zero (a);
|
||||||
|
@ -6029,7 +6029,13 @@ static int fp_read_radix(fp_int *a, const char *str, int radix)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (y >= radix) {
|
if (y >= radix) {
|
||||||
return FP_VAL;
|
/* Check if whitespace at end of line */
|
||||||
|
while (CharIsWhiteSpace(*str))
|
||||||
|
++str;
|
||||||
|
if (*str)
|
||||||
|
return FP_VAL;
|
||||||
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the char was found in the map
|
/* if the char was found in the map
|
||||||
|
Reference in New Issue
Block a user