aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-01-10 18:02:38 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-01-10 18:02:38 +0100
commit0f592d7fb94c5887528d0ee24020c2225ab71c28 (patch)
treea0d0908321c3685ffc757da7f82922205c2dfa70
parent604b7b6cc03bab020f03d35f0064ab0e87845616 (diff)
downloadbusybox-w32-0f592d7fb94c5887528d0ee24020c2225ab71c28.tar.gz
busybox-w32-0f592d7fb94c5887528d0ee24020c2225ab71c28.tar.bz2
busybox-w32-0f592d7fb94c5887528d0ee24020c2225ab71c28.zip
tar: tighten up pax header validity check
function old new delta get_header_tar 1785 1795 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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
115 */ 115 */
116 p += len; 116 p += len;
117 sz -= len; 117 sz -= len;
118 if ((int)sz < 0 118 if (
119 /** (int)sz < 0 - not good enough for huge malicious VALUE of 2^32-1 */
120 (int)(sz|len) < 0 /* this works */
119 || len == 0 121 || len == 0
120 || errno != EINVAL 122 || errno != EINVAL
121 || *end != ' ' 123 || *end != ' '