[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. 99ae9353f6834da0cb73f59f4b32d1f0ae1263fa
Stephen Gran
steve at lobefin.net
Thu Sep 4 12:37:07 UTC 2008
The following commit has been merged in the debian/unstable branch:
commit ff0dc3632388c56cc1fbfbf1bd46a7acb1ecd8dc
Author: Stephen Gran <steve at lobefin.net>
Date: Thu Sep 4 13:25:54 2008 +0100
Revert "fix handling of MSZIP compressed folders (bb#882)"
This reverts commit 3d9a9f5f2a003adc11e7fecaabd864dc98a018e5.
diff --git a/ChangeLog b/ChangeLog
index 0753613..40453da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,3 @@
-Tue Mar 18 11:25:00 CET 2008 (tk)
----------------------------------
- * libclamav/mspack.c: fix handling of MSZIP compressed folders (bb#882)
-
Mon Mar 17 17:25:44 EET 2008 (edwin)
------------------------------------
* libclamav/message.c: degrade some warning messages to debug (bb #880).
diff --git a/libclamav/mspack.c b/libclamav/mspack.c
index 24b5b2b..d509f34 100644
--- a/libclamav/mspack.c
+++ b/libclamav/mspack.c
@@ -104,7 +104,6 @@ static const unsigned short mszip_bit_mask_tab[17] = {
if (mszip_read_input(zip)) return zip->error; \
i_ptr = zip->i_ptr; \
i_end = zip->i_end; \
- if(i_ptr == i_end) break; \
} \
bit_buffer |= *i_ptr++ << bits_left; bits_left += 8; \
} \
@@ -127,6 +126,18 @@ static int mszip_read_input(struct mszip_stream *zip) {
int read = zip->read ? zip->read(zip->file, zip->inbuf, (int)zip->inbuf_size) : cli_readn(zip->fd, zip->inbuf, (int)zip->inbuf_size);
if (read < 0) return zip->error = CL_EIO;
+ if (read == 0) {
+ if (zip->input_end) {
+ cli_dbgmsg("mszip_read_input: out of input bytes\n");
+ return zip->error = CL_EIO;
+ }
+ else {
+ read = 1;
+ zip->inbuf[0] = 0;
+ zip->input_end = 1;
+ }
+ }
+
zip->i_ptr = &zip->inbuf[0];
zip->i_end = &zip->inbuf[read];
@@ -380,11 +391,9 @@ static int mszip_inflate(struct mszip_stream *zip) {
if (mszip_read_input(zip)) return zip->error;
i_ptr = zip->i_ptr;
i_end = zip->i_end;
- if(i_ptr == i_end) break;
}
lens_buf[i++] = *i_ptr++;
}
- if (i < 4) return INF_ERR_BITBUF;
/* get the length and its complement */
length = lens_buf[0] | (lens_buf[1] << 8);
@@ -397,7 +406,6 @@ static int mszip_inflate(struct mszip_stream *zip) {
if (mszip_read_input(zip)) return zip->error;
i_ptr = zip->i_ptr;
i_end = zip->i_end;
- if(i_ptr == i_end) break;
}
this_run = length;
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list