Browse code

blob limits

git-svn: trunk@3633

aCaB authored on 2008/02/15 03:34:20
Showing 3 changed files
... ...
@@ -1,3 +1,6 @@
1
+Thu Feb 14 19:21:03 CET 2008 (acab)
2
+  * libclamav: limits in blobs
3
+
1 4
 Thu Feb 14 16:25:11 CET 2008 (acab)
2 5
 -----------------------------------
3 6
   * libclamav: fix warnings in pdf and untar
... ...
@@ -628,8 +628,8 @@ fileblobAddData(fileblob *fb, const unsigned char *data, size_t len)
628 628
 				if(ctx->scanned)
629 629
 					*ctx->scanned += (unsigned long)len / CL_COUNT_PRECISION;
630 630
 				fb->bytes_scanned += (unsigned long)len;
631
-
632
-				if((len > 5) && (cli_scanbuff(data, (unsigned int)len, ctx->virname, ctx->engine, CL_TYPE_BINARY_DATA) == CL_VIRUS)) {
631
+				
632
+				if((len > 5) && cli_updatelimits(ctx, len)==CL_CLEAN && (cli_scanbuff(data, (unsigned int)len, ctx->virname, ctx->engine, CL_TYPE_BINARY_DATA) == CL_VIRUS)) {
633 633
 					cli_dbgmsg("fileblobAddData: found %s\n", *ctx->virname);
634 634
 					fb->isInfected = 1;
635 635
 				}
... ...
@@ -60,9 +60,6 @@ int cli_scanbuff(const unsigned char *buffer, uint32_t length, cli_ctx *ctx, cli
60 60
 	return CL_ENULLARG;
61 61
     }
62 62
 
63
-    if(cli_updatelimits(ctx, length)!=CL_CLEAN)
64
-        return CL_CLEAN;
65
-
66 63
     groot = engine->root[0]; /* generic signatures */
67 64
 
68 65
     if(ftype) {