[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:13:01 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 4bf5eb79913361987a4279e2466ece70c6662205
Author: aCaB <acab at clamav.net>
Date:   Wed Dec 16 15:34:59 2009 +0100

    bb#1768

diff --git a/ChangeLog b/ChangeLog
index 7711473..9d3dbb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Dec 16 15:33:01 CET 2009 (acab)
+-----------------------------------
+ * libclamav/unzip.c: do not mark embedded zipfiles as
+		       encrypted.zip (bb#1768)
+
 Wed Dec 16 15:22:28 CET 2009 (acab)
 -----------------------------------
  * clamd/server-th.c: remove c++ comment (bb#1751)
diff --git a/libclamav/unzip.c b/libclamav/unzip.c
index bcc8e32..63a19c0 100644
--- a/libclamav/unzip.c
+++ b/libclamav/unzip.c
@@ -297,7 +297,7 @@ static int unz(uint8_t *src, uint32_t csize, uint32_t usize, uint16_t method, ui
   return ret;
 }
 
-static unsigned int lhdr(fmap_t *map, uint32_t loff,uint32_t zsize, unsigned int *fu, unsigned int fc, uint8_t *ch, int *ret, cli_ctx *ctx, char *tmpd) {
+static unsigned int lhdr(fmap_t *map, uint32_t loff,uint32_t zsize, unsigned int *fu, unsigned int fc, uint8_t *ch, int *ret, cli_ctx *ctx, char *tmpd, int detect_encrypted) {
   uint8_t *lh, *zip;
   char name[256];
   uint32_t csize, usize;
@@ -362,7 +362,7 @@ static unsigned int lhdr(fmap_t *map, uint32_t loff,uint32_t zsize, unsigned int
     return 0;
   }
 
-  if((LH_flags & F_ENCR) && DETECT_ENCRYPTED) {
+  if(detect_encrypted && (LH_flags & F_ENCR) && DETECT_ENCRYPTED) {
     cli_dbgmsg("cli_unzip: Encrypted files found in archive.\n");
     *ctx->virname = "Encrypted.Zip";
     *ret = CL_VIRUS;
@@ -469,7 +469,7 @@ static unsigned int chdr(fmap_t *map, uint32_t coff, uint32_t zsize, unsigned in
   coff+=CH_clen;
 
   if(CH_off<zsize-SIZEOF_LH) {
-      lhdr(map, CH_off, zsize-CH_off, fu, fc, ch, ret, ctx, tmpd);
+      lhdr(map, CH_off, zsize-CH_off, fu, fc, ch, ret, ctx, tmpd, 1);
   } else cli_dbgmsg("cli_unzip: ch - local hdr out of file\n");
   fmap_unneed_ptr(map, ch, SIZEOF_CH);
   return last?0:coff;
@@ -525,7 +525,7 @@ int cli_unzip(cli_ctx *ctx) {
   } else cli_dbgmsg("cli_unzip: central not found, using localhdrs\n");
   if(fu<=(fc/4)) { /* FIXME: make up a sane ratio or remove the whole logic */
     fc = 0;
-    while (ret==CL_CLEAN && lhoff<fsize && (coff=lhdr(map, lhoff, fsize-lhoff, &fu, fc+1, NULL, &ret, ctx, tmpd))) {
+    while (ret==CL_CLEAN && lhoff<fsize && (coff=lhdr(map, lhoff, fsize-lhoff, &fu, fc+1, NULL, &ret, ctx, tmpd, 1))) {
       fc++;
       lhoff+=coff;
       if (ctx->engine->maxfiles && fu>=ctx->engine->maxfiles) {
@@ -558,7 +558,7 @@ int cli_unzip_single(cli_ctx *ctx, off_t lhoffl) {
     return CL_CLEAN;
   }
 
-  lhdr(map, lhoffl, fsize, &fu, 0, NULL, &ret, ctx, NULL);
+  lhdr(map, lhoffl, fsize, &fu, 0, NULL, &ret, ctx, NULL, 0);
 
   return ret;
 }

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list