mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
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;
|
||||
}
|
||||
|
||||
/* Skip whitespace at end of str */
|
||||
while (CharIsWhiteSpace(*str))
|
||||
++str;
|
||||
/* if digit in isn't null term, then invalid character was found */
|
||||
if (*str != '\0') {
|
||||
mp_zero (a);
|
||||
|
@ -6029,7 +6029,13 @@ static int fp_read_radix(fp_int *a, const char *str, int 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
|
||||
|
Reference in New Issue
Block a user