aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-11 22:20:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-11 22:20:59 +0000
commitee1b3b1042c8077cda5027bc0ce317662a1d8feb (patch)
treec62350385e56ce7c31479b6e0e99357bd2dbaf29 /archival/libunarchive
parente18d21dda419e768ca047aa74af869e8b5d901c2 (diff)
downloadbusybox-w32-ee1b3b1042c8077cda5027bc0ce317662a1d8feb.tar.gz
busybox-w32-ee1b3b1042c8077cda5027bc0ce317662a1d8feb.tar.bz2
busybox-w32-ee1b3b1042c8077cda5027bc0ce317662a1d8feb.zip
cpio: on unpack, limit filename length to 8k; shorten comment a bit
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/get_header_cpio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c
index 95d36cca8..307d2a66d 100644
--- a/archival/libunarchive/get_header_cpio.c
+++ b/archival/libunarchive/get_header_cpio.c
@@ -37,6 +37,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
37 /* There can be padding before archive header */ 37 /* There can be padding before archive header */
38 data_align(archive_handle, 4); 38 data_align(archive_handle, 4);
39 39
40//TODO: this function is used only here, make it static?
40 if (archive_xread_all_eof(archive_handle, (unsigned char*)cpio_header, 110) == 0) { 41 if (archive_xread_all_eof(archive_handle, (unsigned char*)cpio_header, 110) == 0) {
41 goto create_hardlinks; 42 goto create_hardlinks;
42 } 43 }
@@ -61,6 +62,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
61 file_header->mtime = mtime; 62 file_header->mtime = mtime;
62 file_header->size = size; 63 file_header->size = size;
63 64
65 namesize &= 0x1fff; /* paranoia: names can't be that long */
64 file_header->name = xzalloc(namesize + 1); 66 file_header->name = xzalloc(namesize + 1);
65 /* Read in filename */ 67 /* Read in filename */
66 xread(archive_handle->src_fd, file_header->name, namesize); 68 xread(archive_handle->src_fd, file_header->name, namesize);