Browse code

fix section handling in petite block

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1397 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2005/03/17 05:59:24
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Mar 16 21:55:44 CET 2005 (tk)
2
+---------------------------------
3
+  * libclamav/pe.c: fix section handling in petite block
4
+
1 5
 Tue Mar 15 18:10:18 GMT 2005 (njh)
2 6
 ---------------------------------
3 7
   * libclamav/mbox.c:	Some Worm.Yaha.K were not being found
... ...
@@ -1177,7 +1177,7 @@ int cli_scanpe(int desc, const char **virname, long int *scanned, const struct c
1177 1177
     }
1178 1178
 
1179 1179
     if(buff[0] != '\xb8' || cli_readint32(buff + 1) != EC32(section_hdr[nsections - 1].VirtualAddress) + EC32(optional_hdr.ImageBase)) {
1180
-	if(buff[0] != '\xb8' || (nsections > 1 && cli_readint32(buff + 1) != EC32(section_hdr[nsections - 2].VirtualAddress) + EC32(optional_hdr.ImageBase)))
1180
+	if(nsections < 2 || buff[0] != '\xb8' || cli_readint32(buff + 1) != EC32(section_hdr[nsections - 2].VirtualAddress) + EC32(optional_hdr.ImageBase))
1181 1181
 	    found = 0;
1182 1182
 	else
1183 1183
 	    found = 1;