From ee1b3b1042c8077cda5027bc0ce317662a1d8feb Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Fri, 11 Jul 2008 22:20:59 +0000 Subject: cpio: on unpack, limit filename length to 8k; shorten comment a bit --- archival/libunarchive/get_header_cpio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'archival/libunarchive') diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index 95d36cc..307d2a6 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) /* There can be padding before archive header */ data_align(archive_handle, 4); +//TODO: this function is used only here, make it static? if (archive_xread_all_eof(archive_handle, (unsigned char*)cpio_header, 110) == 0) { goto create_hardlinks; } @@ -61,6 +62,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) file_header->mtime = mtime; file_header->size = size; + namesize &= 0x1fff; /* paranoia: names can't be that long */ file_header->name = xzalloc(namesize + 1); /* Read in filename */ xread(archive_handle->src_fd, file_header->name, namesize); -- cgit v1.1