From: Tobias Stoeckmann Date: Sun, 26 Apr 2026 16:11:28 +0000 (+0200) Subject: mtree: Fix hex parser X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ce282da019f8bc7e01deeb41088224a9f2cf2b;p=thirdparty%2Flibarchive.git mtree: Fix hex parser Digits a-f/A-F need an offset of 10. Resolves #2975. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 4a5a49ca8..97825bb63 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -2029,9 +2029,9 @@ parsedigit(char c) if (c >= '0' && c <= '9') return c - '0'; else if (c >= 'a' && c <= 'f') - return c - 'a'; + return 10 + c - 'a'; else if (c >= 'A' && c <= 'F') - return c - 'A'; + return 10 + c - 'A'; else return -1; }