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

Török Edvin edwin at clamav.net
Sun Apr 4 01:19:29 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 551e73b783cb1461d01eb0a41e2ad64229111d3c
Author: Török Edvin <edwin at clamav.net>
Date:   Tue Feb 9 18:23:10 2010 +0200

    matcher-ac: move leaf checks inside IS_FINAL.
    
    All other were removed during ac_maketrans.

diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c
index 3f2507e..a43f458 100644
--- a/libclamav/matcher-ac.c
+++ b/libclamav/matcher-ac.c
@@ -295,7 +295,7 @@ static int ac_maketrans(struct cli_matcher *root)
 	    continue;
 	for(i = 0; i < 256; i++) {
 	    child = node->trans[i];
-	    if(!child) {
+	    if (!child || (!IS_FINAL(child) && IS_LEAF(child))) {
 		struct cli_ac_node *failtarget = node->fail;
 		while(IS_LEAF(failtarget) || !failtarget->trans[i])
 		    failtarget = failtarget->fail;
@@ -892,14 +892,12 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v
     current = root->ac_root;
 
     for(i = 0; i < length; i++)  {
-
-	if(IS_LEAF(current))
-	    current = current->fail;
-
 	current = current->trans[buffer[i]];
 
 	if(IS_FINAL(current)) {
 	    patt = current->list;
+	    if (IS_LEAF(current))
+		current = current->fail;
 	    while(patt) {
 		bp = i + 1 - patt->depth;
 		if(ac_findmatch(buffer, bp, length, patt, &matchend)) {

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list