Browse code

fix handling of nodes which also match single bytes (bb#1054)

git-svn: trunk@3890

Tomasz Kojm authored on 2008/06/13 20:52:08
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Fri Jun 13 13:10:15 CEST 2008 (tk)
2
+----------------------------------
3
+  * libclamav/matcher-ac.c: fix handling of nodes which also match single
4
+			    bytes (bb#1054)
5
+
1 6
 Fri Jun 13 02:01:15 CEST 2008 (tk)
2 7
 ----------------------------------
3 8
   * shared/cfgparser.c: handle memory errors in OPT_COMPSIZE
... ...
@@ -126,7 +126,7 @@ int cli_ac_addpatt(struct cli_matcher *root, struct cli_ac_patt *pattern)
126 126
 
127 127
     ph = pt->list;
128 128
     while(ph) {
129
-	if((ph->length == pattern->length) && (ph->prefix_length == pattern->prefix_length)) {
129
+	if((ph->length == pattern->length) && (ph->prefix_length == pattern->prefix_length) && (ph->ch[0] == pattern->ch[0]) && (ph->ch[1] == pattern->ch[1])) {
130 130
 	    if(!memcmp(ph->pattern, pattern->pattern, ph->length * sizeof(uint16_t)) && !memcmp(ph->prefix, pattern->prefix, ph->prefix_length * sizeof(uint16_t))) {
131 131
 		if(!ph->alt && !pattern->alt) {
132 132
 		    match = 1;
... ...
@@ -87,7 +87,7 @@ static pthread_mutex_t cli_ctime_mutex = PTHREAD_MUTEX_INITIALIZER;
87 87
 #define       P_tmpdir        "C:\\WINDOWS\\TEMP"
88 88
 #endif
89 89
 
90
-#define CL_FLEVEL 31 /* don't touch it */
90
+#define CL_FLEVEL 32 /* don't touch it */
91 91
 
92 92
 uint8_t cli_debug_flag = 0, cli_leavetemps_flag = 0;
93 93