summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-08-03 21:33:49 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-08-03 21:37:33 +0300
commit4ac70b2e70b0601768c1dbe4c503cbc7e30b8f83 (patch)
tree20744df7b8b9d68307ce24052f740aaa69dcb6c2
parent9823ff6b224f254cc3d6bf57131085b462e3c562 (diff)
downloadapk-tools-4ac70b2e70b0601768c1dbe4c503cbc7e30b8f83.tar.gz
apk-tools-4ac70b2e70b0601768c1dbe4c503cbc7e30b8f83.tar.bz2
apk-tools-4ac70b2e70b0601768c1dbe4c503cbc7e30b8f83.tar.xz
apk-tools-4ac70b2e70b0601768c1dbe4c503cbc7e30b8f83.zip
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"
-rw-r--r--libfetch/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfetch/common.c b/libfetch/common.c
index d87c7ed..64a9dc7 100644
--- a/libfetch/common.c
+++ b/libfetch/common.c
@@ -180,7 +180,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;