libfetch: fix http chunked mode handling

Unbreak handling of base 16 in fetch_parseuint(). It is used
only in http chunked mode handling.

Fixes: "libfetch: fix range checking for http/ftp protocol parsing"
cute-signatures
Timo Teräs 2021-08-03 21:33:49 +03:00
parent aa44cfac05
commit b30e94c0ac
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ fetch_parseuint(const char *str, const char **endptr, int radix, uintmax_t max)
unsigned char ch = (unsigned char)*p;
if (isdigit(ch))
d = ch - '0';
else d = tolower(ch - 'a');
else d = tolower(ch) - 'a' + 10;
if (d > radix || val > maxx) goto err;
val *= radix;
if (val > max-d) goto err;