Browse code

fix warning on AES encrypted zip archives (bb#430)

git-svn: trunk@3088

Tomasz Kojm authored on 2007/05/30 22:51:15
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed May 30 15:07:58 CEST 2007 (tk)
2
+----------------------------------
3
+  * libclamav/scanners.c: fix warning on AES encrypted zip archives (bb#430)
4
+
1 5
 Wed May 30 13:27:09 CEST 2007 (tk)
2 6
 ----------------------------------
3 7
   * fresclam/manager.c: add sanity check for %v (bb#463)
... ...
@@ -441,17 +441,19 @@ static int cli_scanzip(int desc, cli_ctx *ctx, off_t sfx_offset, uint32_t *sfx_c
441 441
 	    break;
442 442
         }
443 443
 
444
-	if(DETECT_ENCRYPTED && encrypted) {
445
-	    cli_dbgmsg("Zip: Encrypted files found in archive.\n");
446
-	    lseek(desc, 0, SEEK_SET);
447
-	    ret = cli_scandesc(desc, ctx, 0, 0, 0, NULL);
448
-	    if(ret < 0) {
444
+	if(encrypted) {
445
+	    if(DETECT_ENCRYPTED) {
446
+		cli_dbgmsg("Zip: Encrypted files found in archive.\n");
447
+		lseek(desc, 0, SEEK_SET);
448
+		ret = cli_scandesc(desc, ctx, 0, 0, 0, NULL);
449
+		if(ret < 0) {
450
+		    break;
451
+		} else if(ret != CL_VIRUS) {
452
+		    *ctx->virname = "Encrypted.Zip";
453
+		    ret = CL_VIRUS;
454
+		}
449 455
 		break;
450
-	    } else if(ret != CL_VIRUS) {
451
-		*ctx->virname = "Encrypted.Zip";
452
-		ret = CL_VIRUS;
453
-	    }
454
-	    break;
456
+	    } else continue;
455 457
 	}
456 458
 
457 459
 	if(ctx->limits) {