git-svn: trunk@671
Tomasz Kojm authored on 2004/07/16 07:46:11... | ... |
@@ -262,11 +262,17 @@ int cli_scanpe(int desc, const char **virname, long int *scanned, const struct c |
262 | 262 |
cli_dbgmsg("Not a PE file\n"); |
263 | 263 |
return CL_CLEAN; |
264 | 264 |
} |
265 |
- lseek(desc, e_lfanew, SEEK_SET); |
|
265 |
+ |
|
266 |
+ if(lseek(desc, e_lfanew, SEEK_SET) < 0) { |
|
267 |
+ /* probably not a PE file */ |
|
268 |
+ cli_dbgmsg("Can't lseek to e_lfanew\n"); |
|
269 |
+ return CL_CLEAN; |
|
270 |
+ } |
|
266 | 271 |
|
267 | 272 |
if(read(desc, &file_hdr, sizeof(struct pe_image_file_hdr)) != sizeof(struct pe_image_file_hdr)) { |
273 |
+ /* bad information in e_lfanew - probably not a PE file */ |
|
268 | 274 |
cli_dbgmsg("Can't read file header\n"); |
269 |
- return CL_EIO; |
|
275 |
+ return CL_CLEAN; |
|
270 | 276 |
} |
271 | 277 |
|
272 | 278 |
if(EC32(file_hdr.Magic) != IMAGE_NT_SIGNATURE) { |