libclamav/readdb.c: fix handling of Engine attrib (bb#2297)

0.96
Tomasz Kojm 15 years ago
parent 42ab31d897
commit 87acc26344
  1. 4
      ChangeLog
  2. 26
      libclamav/readdb.c

@ -1,3 +1,7 @@
Fri Oct 8 14:23:24 CEST 2010 (tk)
----------------------------------
* libclamav/readdb.c: fix handling of Engine attrib (bb#2297)
Tue Oct 5 18:14:59 EEST 2010 (edwin)
-------------------------------------
* libclamav/pdf.c: Fix 'Unknown error code ERROR'(bb #2296).

@ -1256,6 +1256,19 @@ static int load_oneldb(char *buffer, int chkpua, int chkign, struct cl_engine *e
return CL_EMALFDB;
}
if(tdb.engine) {
if(tdb.engine[0] > cl_retflevel()) {
cli_dbgmsg("cli_loadldb: Signature for %s not loaded (required f-level: %u)\n", virname, tdb.engine[0]);
FREE_TDB(tdb);
(*sigs)--;
return CL_SUCCESS;
} else if(tdb.engine[1] < cl_retflevel()) {
FREE_TDB(tdb);
(*sigs)--;
return CL_SUCCESS;
}
}
if(!tdb.target) {
cli_errmsg("cli_loadldb: No target specified in TDB\n");
FREE_TDB(tdb);
@ -1337,19 +1350,6 @@ static int load_oneldb(char *buffer, int chkpua, int chkign, struct cl_engine *e
return CL_EMEM;
tdb.macro_ptids[i-1] = root->ac_patterns-1;
}
if(tdb.engine) {
if(tdb.engine[0] > cl_retflevel()) {
cli_dbgmsg("cli_loadldb: Signature for %s not loaded (required f-level: %u)\n", virname, tdb.engine[0]);
FREE_TDB(tdb);
(*sigs)--;
return CL_SUCCESS;
} else if(tdb.engine[1] < cl_retflevel()) {
FREE_TDB(tdb);
(*sigs)--;
return CL_SUCCESS;
}
}
}
memcpy(&lsig->tdb, &tdb, sizeof(tdb));
return CL_SUCCESS;

Loading…
Cancel
Save