Fix a couple bugs

remotes/push_mirror/0.98.2
Shawn Webb 12 years ago
parent 3c29ca0b10
commit 43adde3e77
  1. 2
      libclamav/matcher.c
  2. 30
      libclamav/pe.c
  3. 5
      libclamav/stats.c

@ -535,7 +535,7 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx)
if(cli_hm_scan(shash1, 2, &virname, ctx->engine->hm_fp, CLI_HASH_SHA1) == CL_VIRUS) {
cli_dbgmsg("cli_checkfp(pe): PE file whitelisted by catalog file\n");
return CL_CLEAN;
return CL_CLEAN;
}
}
}

@ -3013,20 +3013,24 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin
}
free(exe_sections);
SHA1Final(&sha1, authsha1);
if(cli_debug_flag) {
char shatxt[SHA1_HASH_SIZE*2+1];
for(i=0; i<SHA1_HASH_SIZE; i++)
sprintf(&shatxt[i*2], "%02x", authsha1[i]);
cli_dbgmsg("Authenticode: %s\n", shatxt);
}
if (flags & CL_CHECKFP_PE_FLAG_AUTHENTICODE) {
SHA1Final(&sha1, authsha1);
if(cli_debug_flag) {
char shatxt[SHA1_HASH_SIZE*2+1];
for(i=0; i<SHA1_HASH_SIZE; i++)
sprintf(&shatxt[i*2], "%02x", authsha1[i]);
cli_dbgmsg("Authenticode: %s\n", shatxt);
}
hlen = dirs[4].Size;
if(hlen < 8)
return CL_VIRUS;
hlen = dirs[4].Size;
if(hlen < 8)
return CL_VIRUS;
hlen -= 8;
hlen -= 8;
return asn1_check_mscat((struct cl_engine *)(ctx->engine), map, at + 8, hlen, authsha1);
return asn1_check_mscat((struct cl_engine *)(ctx->engine), map, at + 8, hlen, authsha1);
} else {
return CL_VIRUS;
}
}

@ -370,6 +370,11 @@ void clamav_stats_remove_sample(const char *virname, const unsigned char *md5, s
if (sample == intel->samples)
intel->samples = sample->next;
if ((sample->sections) && (sample->sections->nsections)) {
free(sample->sections->sections);
free(sample->sections);
}
free_sample(sample);
intel->nsamples--;
}

Loading…
Cancel
Save