[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Tomasz Kojm tkojm at clamav.net
Sun Apr 4 01:14:30 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 8d2654bb3f7981a8d78ac223e77e3ebff0e581cc
Author: Tomasz Kojm <tkojm at clamav.net>
Date:   Tue Jan 12 12:16:13 2010 +0100

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

diff --git a/ChangeLog b/ChangeLog
index 6027ff0..d6c2478 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
diff --git a/libclamav/readdb.c b/libclamav/readdb.c
index 8ab279f..5f93e65 100644
--- a/libclamav/readdb.c
+++ b/libclamav/readdb.c
@@ -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()) {

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list