From 4bf5eb79913361987a4279e2466ece70c6662205 Mon Sep 17 00:00:00 2001 From: aCaB Date: Wed, 16 Dec 2009 15:34:59 +0100 Subject: [PATCH] bb#1768 --- ChangeLog | 5 +++++ libclamav/unzip.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 771147384..9d3dbb778 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 bcc8e32c7..63a19c079 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_offengine->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; }