libclamav/readdb.c: when some lsig's attribute is unknown ignore the entire signature and not the attribute itself

0.96
Tomasz Kojm 16 years ago
parent 15f413d157
commit 8d2654bb3f
  1. 5
      ChangeLog
  2. 19
      libclamav/readdb.c

@ -1,3 +1,8 @@
Tue Jan 12 12:14:08 CET 2010 (tk)
---------------------------------
* libclamav/readdb.c: when some lsig's attribute is unknown ignore the
entire signature and not the attribute itself
Fri Jan 8 15:20:10 CET 2010 (tk)
---------------------------------
* libclamav: handle zmd/rmd with cdb (bb#1579)

@ -972,7 +972,7 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb)
if(!apt) {
cli_dbgmsg("lsigattribs: Unknown attribute name '%s'\n", tokens[i]);
continue;
return 1;
}
switch(apt->type) {
@ -1101,7 +1101,7 @@ static int load_oneldb(char *buffer, int chkpua, int chkign, struct cl_engine *e
uint32_t lsigid[2];
int ret;
tokens_count = cli_strtokenize(buffer, ';', LDB_TOKENS + 1, (const char **) tokens);
tokens_count = cli_strtokenize(buffer, ';', LDB_TOKENS + 1, (const char **) tokens);
if(tokens_count < 4) {
return CL_EMALFDB;
}
@ -1142,16 +1142,22 @@ static int load_oneldb(char *buffer, int chkpua, int chkign, struct cl_engine *e
#ifdef USE_MPOOL
tdb.mempool = engine->mempool;
#endif
if(lsigattribs(tokens[1], &tdb) == -1) {
if((ret = lsigattribs(tokens[1], &tdb))) {
FREE_TDB(tdb);
if(ret == 1) {
cli_dbgmsg("cli_loadldb: Not supported attribute(s) in logical signature for %s, skipping\n", virname);
*sigs--;
return CL_SUCCESS;
}
return CL_EMALFDB;
}
if(!tdb.target) {
cli_errmsg("cli_loadldb: No target specified in TDB\n");
FREE_TDB(tdb);
return CL_EMALFDB;
} else if(tdb.target[0] >= CLI_MTARGETS) {
cli_dbgmsg("cli_loadldb: Not supported target type in logical signature for %s\n", virname);
cli_dbgmsg("cli_loadldb: Not supported target type in logical signature for %s, skipping\n", virname);
FREE_TDB(tdb);
*sigs--;
return CL_SUCCESS;
@ -1215,9 +1221,8 @@ static int load_oneldb(char *buffer, int chkpua, int chkign, struct cl_engine *e
sig = tokens[3 + i];
}
if((ret = cli_parse_add(root, virname, sig, 0, 0, offset, target, lsigid, options))) {
return CL_EMALFDB;
}
if((ret = cli_parse_add(root, virname, sig, 0, 0, offset, target, lsigid, options)))
return ret;
if(tdb.engine) {
if(tdb.engine[0] > cl_retflevel()) {

Loading…
Cancel
Save