Browse code

bb#2307

aCaB authored on 2010/11/11 00:33:12
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Nov 10 16:31:49 CET 2010 (acab)
2
+-----------------------------------
3
+ * libclamav: Set the unreliability flag on (un)packed files (bb#2307)
4
+
1 5
 Sat Nov  6 15:47:01 EET 2010 (edwin)
2 6
 ------------------------------------
3 7
  * libclamav/c++: Update embedded copy of LLVM to version 2.8 (bb #2327)
... ...
@@ -1348,6 +1348,11 @@ int cli_scanpe(cli_ctx *ctx)
1348 1348
 	    }
1349 1349
     }
1350 1350
 
1351
+
1352
+    /* !!!!!!!!!!!!!!    PACKERS START HERE    !!!!!!!!!!!!!! */
1353
+    ctx->corrupted_input = 2; /* caller will reset on return */
1354
+
1355
+
1351 1356
     /* UPX, FSG, MEW support */
1352 1357
 
1353 1358
     /* try to find the first section with physical size == 0 */
... ...
@@ -2356,8 +2356,11 @@ static int magic_scandesc(int desc, cli_ctx *ctx, cli_file_t type)
2356 2356
 	 * in raw mode. Now we will try to unpack them
2357 2357
 	 */
2358 2358
 	case CL_TYPE_MSEXE:
2359
-	    if(SCAN_PE && ctx->dconf->pe)
2359
+	    if(SCAN_PE && ctx->dconf->pe) {
2360
+		unsigned int corrupted_input = ctx->corrupted_input;
2360 2361
 		ret = cli_scanpe(ctx);
2362
+		ctx->corrupted_input = corrupted_input;
2363
+	    }
2361 2364
 	    break;
2362 2365
 	default:
2363 2366
 	    break;