Correct INT_MAX overflow check to UINT_MAX

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2023-02-23 13:50:48 +00:00
parent e91cbcfb2c
commit ce16474d91

View file

@ -901,7 +901,7 @@ static int oid_parse_number(unsigned int *num, const char **p, const char *bound
*num = 0;
while (*p < bound && **p >= '0' && **p <= '9') {
ret = 0;
if (*num > (INT_MAX / 10)) {
if (*num > (UINT_MAX / 10)) {
return MBEDTLS_ERR_ASN1_INVALID_DATA;
}
*num *= 10;