aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-06-28 07:46:32 +0100
committerRon Yorston <rmy@pobox.com>2021-06-28 07:46:32 +0100
commite1ad66c0b8fd58a7158d40771175a7dab224202d (patch)
tree959d687eee9637151ad5798322586174de331141 /archival/libarchive
parent0fdf99bee07b6c38795eb5415b5e337ab82cfba8 (diff)
parent5dbbd0a6f52befe6bc57baf97d39168e595197f1 (diff)
downloadbusybox-w32-e1ad66c0b8fd58a7158d40771175a7dab224202d.tar.gz
busybox-w32-e1ad66c0b8fd58a7158d40771175a7dab224202d.tar.bz2
busybox-w32-e1ad66c0b8fd58a7158d40771175a7dab224202d.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/decompress_unlzma.c5
-rw-r--r--archival/libarchive/get_header_cpio.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c
index 0744f231a..fb5aac8fe 100644
--- a/archival/libarchive/decompress_unlzma.c
+++ b/archival/libarchive/decompress_unlzma.c
@@ -290,8 +290,11 @@ unpack_lzma_stream(transformer_state_t *xstate)
290 uint32_t pos; 290 uint32_t pos;
291 291
292 pos = buffer_pos - rep0; 292 pos = buffer_pos - rep0;
293 if ((int32_t)pos < 0) 293 if ((int32_t)pos < 0) {
294 pos += header.dict_size; 294 pos += header.dict_size;
295 if ((int32_t)pos < 0)
296 goto bad;
297 }
295 match_byte = buffer[pos]; 298 match_byte = buffer[pos];
296 do { 299 do {
297 int bit; 300 int bit;
diff --git a/archival/libarchive/get_header_cpio.c b/archival/libarchive/get_header_cpio.c
index 4ad174732..9ad0557c2 100644
--- a/archival/libarchive/get_header_cpio.c
+++ b/archival/libarchive/get_header_cpio.c
@@ -20,7 +20,7 @@ typedef struct hardlinks_t {
20char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) 20char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
21{ 21{
22 file_header_t *file_header = archive_handle->file_header; 22 file_header_t *file_header = archive_handle->file_header;
23 char cpio_header[110]; 23 char cpio_header[111];
24 int namesize; 24 int namesize;
25 int major, minor, nlink, mode, inode; 25 int major, minor, nlink, mode, inode;
26 unsigned size, uid, gid, mtime; 26 unsigned size, uid, gid, mtime;
@@ -43,6 +43,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
43 bb_simple_error_msg_and_die("unsupported cpio format, use newc or crc"); 43 bb_simple_error_msg_and_die("unsupported cpio format, use newc or crc");
44 } 44 }
45 45
46 cpio_header[110] = '\0'; /* sscanf may call strlen which may break without this */
46 if (sscanf(cpio_header + 6, 47 if (sscanf(cpio_header + 6,
47 "%8x" "%8x" "%8x" "%8x" 48 "%8x" "%8x" "%8x" "%8x"
48 "%8x" "%8x" "%8x" /*maj,min:*/ "%*16c" 49 "%8x" "%8x" "%8x" /*maj,min:*/ "%*16c"