From b30e94c0aca10b57ce734f7fcf9b7600537dc136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 3 Aug 2021 21:33:49 +0300 Subject: [PATCH] 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" --- libfetch/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfetch/common.c b/libfetch/common.c index 01c5f2b..248b575 100644 --- a/libfetch/common.c +++ b/libfetch/common.c @@ -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;