Browse code

lseek check removed

git-svn: trunk@2482

aCaB authored on 2006/11/05 08:26:21
Showing 2 changed files
... ...
@@ -1,3 +1,6 @@
1
+Sun Nov  5 00:20:02 CET 2006 (acab)
2
+  * libclamav/pe.c:     lseek fix for last commit
3
+
1 4
 Sat Nov  4 23:57:14 CET 2006 (acab)
2 5
 -----------------------------------
3 6
   * libclamav/pe.c:	Handle long optional header
... ...
@@ -441,15 +441,7 @@ int cli_scanpe(int desc, cli_ctx *ctx)
441 441
 	}
442 442
 	if (EC16(file_hdr.SizeOfOptionalHeader)==0x148) {
443 443
 	  cli_dbgmsg("Found long header\n");
444
-	  if (lseek(desc, (0x148-0xe0), SEEK_CUR)==-1) { /* Seek to the end of the long header */
445
-	    if(DETECT_BROKEN) {
446
-	      if(ctx->virname)
447
-		*ctx->virname = "Broken.Executable";
448
-	      return CL_VIRUS;
449
-	    }
450
-	    cli_dbgmsg("But the file is too short to fit it\n");
451
-	    return CL_CLEAN;
452
-	  }
444
+	  lseek(desc, (0x148-0xe0), SEEK_CUR); /* Seek to the end of the long header */
453 445
 	}
454 446
 
455 447
 	if(EC16(optional_hdr32.Magic) != PE32_SIGNATURE) {