mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 18:33:16 +00:00
Fix all-match mode bug in PE section hash scans
The PE section hash scanning code didn't implement the all-match check. While this check isn't the ideal implementation for all-match mode... (see the commit message for the previous commit) ...it's simple enough to add the all-match check here for now.
This commit is contained in:
parent
eee290a69e
commit
c24654d244
1 changed files with 9 additions and 5 deletions
|
@ -2847,8 +2847,11 @@ int cli_scanpe(cli_ctx *ctx)
|
|||
if ((DCONF & PE_CONF_MD5SECT) && ctx->engine->hm_mdb) {
|
||||
ret = scan_pe_mdb(ctx, &(peinfo->sections[i]));
|
||||
if (ret != CL_CLEAN) {
|
||||
// TODO Handle allmatch
|
||||
if (ret != CL_VIRUS)
|
||||
if (ret == CL_VIRUS && !SCAN_ALLMATCHES) {
|
||||
cli_dbgmsg("------------------------------------\n");
|
||||
cli_exe_info_destroy(peinfo);
|
||||
return ret;
|
||||
} else if (ret != CL_VIRUS) {
|
||||
cli_errmsg("cli_scanpe: scan_pe_mdb failed: %s!\n", cl_strerror(ret));
|
||||
|
||||
cli_dbgmsg("------------------------------------\n");
|
||||
|
@ -2858,6 +2861,7 @@ int cli_scanpe(cli_ctx *ctx)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Don't bail out here
|
||||
if (peinfo->is_pe32plus) { /* Do not continue for PE32+ files */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue