minor code cleanup

0.96
Tomasz Kojm 15 years ago
parent 7770d314ff
commit 661e8e3f5a
  1. 2
      libclamav/matcher-ac.c
  2. 7
      libclamav/matcher.c
  3. 11
      libclamav/scanners.c

@ -1232,8 +1232,8 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v
}
offmatrix = mdata->offmatrix[pt->sigid - 1];
found = 0;
if(pt->partno != 1) {
found = 0;
for(j = 1; j <= CLI_DEFAULT_AC_TRACKLEN + 1 && offmatrix[pt->partno - 2][j] != -1; j++) {
found = j;
if(pt->maxdist)

@ -381,8 +381,6 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx)
char md5[33];
unsigned int i;
const char *virname;
const struct cli_md5m_patt *patt = NULL;
if(ctx->engine->md5_fp && cli_md5m_scan(digest, size, &virname, ctx->engine->md5_fp) == CL_VIRUS) {
cli_dbgmsg("cli_checkfp(): Found false positive detection (fp sig: %s)\n", virname);
@ -462,8 +460,8 @@ int32_t cli_bcapi_matchicon(struct cli_bc_ctx *ctx , const uint8_t* grp1, int32_
cli_dbgmsg("bytecode: matchicon only works with PE files\n");
return -1;
}
if (grp1len > sizeof(group1)-1 ||
grp2len > sizeof(group2)-1)
if ((size_t) grp1len > sizeof(group1)-1 ||
(size_t) grp2len > sizeof(group2)-1)
return -1;
oldvirname = ((cli_ctx*)ctx->ctx)->virname;
((cli_ctx*)ctx->ctx)->virname = NULL;
@ -711,7 +709,6 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli
return CL_VIRUS;
if(!ftonly && ctx->engine->md5_hdb) {
const struct cli_md5m_patt *patt;
if(!refhash) {
cli_md5_final(digest, &md5ctx);
refhash = digest;

@ -1735,17 +1735,6 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_
if(ret >= CL_TYPENO) {
ctx->recursion++;
/*
if(type == CL_TYPE_TEXT_ASCII) {
lseek(desc, 0, SEEK_SET);
nret = cli_scandesc(desc, ctx, 0, ret, 1, NULL);
if(nret == CL_VIRUS)
cli_dbgmsg("%s found in descriptor %d when scanning file type %u\n", *ctx->virname, desc, ret);
}
*/
if(nret != CL_VIRUS) {
lastzip = lastrar = 0xdeadbeef;
fpt = ftoffset;

Loading…
Cancel
Save