[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:21:42 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 548b55beb87b3887ffce300f1b937f6247569ac0
Author: aCaB <acab at clamav.net>
Date:   Thu Mar 4 19:52:33 2010 +0100

    don't let scandesc rehash when we already have an hash

diff --git a/libclamav/matcher.h b/libclamav/matcher.h
index d7ae8a3..2d5d020 100644
--- a/libclamav/matcher.h
+++ b/libclamav/matcher.h
@@ -164,7 +164,7 @@ struct cli_target_info {
 int cli_scanbuff(const unsigned char *buffer, uint32_t length, uint32_t offset, cli_ctx *ctx, cli_file_t ftype, struct cli_ac_data **acdata);
 
 int cli_scandesc(int desc, cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli_matched_type **ftoffset, unsigned int acmode);
-int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli_matched_type **ftoffset, unsigned int acmode, unsigned char *digest);
+int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli_matched_type **ftoffset, unsigned int acmode, unsigned char *refhash);
 int cli_caloff(const char *offstr, struct cli_target_info *info, fmap_t *map, unsigned int target, uint32_t *offdata, uint32_t *offset_min, uint32_t *offset_max);
 
 int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx);
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index e6c5448..9864aa4 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -1685,7 +1685,7 @@ static int cli_scanembpe(int desc, cli_ctx *ctx)
     return CL_CLEAN;
 }
 
-static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_t *dettype)
+static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_t *dettype, unsigned char *refhash)
 {
 	int ret = CL_CLEAN, nret = CL_CLEAN;
 	struct cli_matched_type *ftoffset = NULL, *fpt;
@@ -1703,7 +1703,7 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_
     if(typercg)
 	acmode |= AC_SCAN_FT;
 
-    ret = cli_fmap_scandesc(ctx, type == CL_TYPE_TEXT_ASCII ? 0 : type, 0, &ftoffset, acmode, NULL);
+    ret = cli_fmap_scandesc(ctx, type == CL_TYPE_TEXT_ASCII ? 0 : type, 0, &ftoffset, acmode, refhash);
 
     if(ret >= CL_TYPENO) {
 	ctx->recursion++;
@@ -1953,7 +1953,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
 	return CL_EMEM;
 
     if(type != CL_TYPE_IGNORED && ctx->engine->sdb) {
-	if((ret = cli_scanraw(ctx, type, 0, &dettype)) == CL_VIRUS) {
+	if((ret = cli_scanraw(ctx, type, 0, &dettype, hash)) == CL_VIRUS) {
 	    ret = cli_checkfp(hash, hashed_size, ctx);
 	    funmap(*ctx->fmap);
 	    ctx->fmap--;
@@ -2220,7 +2220,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
 
     /* CL_TYPE_HTML: raw HTML files are not scanned, unless safety measure activated via DCONF */
     if(type != CL_TYPE_IGNORED && (type != CL_TYPE_HTML || !(DCONF_DOC & DOC_CONF_HTML_SKIPRAW)) && !ctx->engine->sdb) {
-	if(cli_scanraw(ctx, type, typercg, &dettype) == CL_VIRUS) {
+	if(cli_scanraw(ctx, type, typercg, &dettype, hash) == CL_VIRUS) {
 	    ret =  cli_checkfp(hash, hashed_size, ctx);
 	    funmap(*ctx->fmap);
 	    ctx->fmap--;

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list