aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive/get_header_tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/libarchive/get_header_tar.c')
-rw-r--r--archival/libarchive/get_header_tar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c
index 32f842095..54d910431 100644
--- a/archival/libarchive/get_header_tar.c
+++ b/archival/libarchive/get_header_tar.c
@@ -115,7 +115,9 @@ static void process_pax_hdr(archive_handle_t *archive_handle, unsigned sz, int g
*/
p += len;
sz -= len;
- if ((int)sz < 0
+ if (
+ /** (int)sz < 0 - not good enough for huge malicious VALUE of 2^32-1 */
+ (int)(sz|len) < 0 /* this works */
|| len == 0
|| errno != EINVAL
|| *end != ' '