aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-03-01 19:29:29 +0000
committermjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-03-01 19:29:29 +0000
commit9d60dc0fbaf3b09e220904626085431d3e74c20b (patch)
treeae9588179fe1ceb57e05bd80851cab4a5a89ad9b
parent24a140fb1cebe4321138e642b7ce12392ada70f0 (diff)
downloadbusybox-w32-9d60dc0fbaf3b09e220904626085431d3e74c20b.tar.gz
busybox-w32-9d60dc0fbaf3b09e220904626085431d3e74c20b.tar.bz2
busybox-w32-9d60dc0fbaf3b09e220904626085431d3e74c20b.zip
When filling the bit buffer, gzip decompression apparently never checked for end of file, causing it to hang on corrupted input.
git-svn-id: svn://busybox.net/trunk/busybox@9950 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--archival/libunarchive/decompress_unzip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index e8cf54bff..b17065d92 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -151,7 +151,10 @@ static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current
151 /* Leave the first 4 bytes empty so we can always unwind the bitbuffer 151 /* Leave the first 4 bytes empty so we can always unwind the bitbuffer
152 * to the front of the bytebuffer, leave 4 bytes free at end of tail 152 * to the front of the bytebuffer, leave 4 bytes free at end of tail
153 * so we can easily top up buffer in check_trailer_gzip() */ 153 * so we can easily top up buffer in check_trailer_gzip() */
154 bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8); 154 if (!(bytebuffer_size = bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8))) {
155 bb_error_msg_and_die("unexpected end of file");
156 }
157 bytebuffer_size += 4;
155 bytebuffer_offset = 4; 158 bytebuffer_offset = 4;
156 } 159 }
157 bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current; 160 bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current;