Browse code

fix possible false matches of alternatives

git-svn: trunk@2045

Tomasz Kojm authored on 2006/06/25 21:33:07
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Jun 25 14:29:22 CEST 2006 (tk)
2
+----------------------------------
3
+  * libclamav/matcher-ac.c: fix possible false matches of alternatives
4
+
1 5
 Fri Jun 23 00:01:16 CEST 2006 (tk)
2 6
 ----------------------------------
3 7
   * docs/signatures.pdf: update
... ...
@@ -227,7 +227,7 @@ inline static int cli_findpos(const char *buffer, unsigned int depth, unsigned i
227 227
 {
228 228
 	unsigned int bufferpos = offset + depth;
229 229
 	unsigned int postfixend = offset + length;
230
-	unsigned int i, j, alt = 0, found = 0;
230
+	unsigned int i, j, alt = 0, found;
231 231
 
232 232
 
233 233
     if(bufferpos >= length)
... ...
@@ -239,6 +239,7 @@ inline static int cli_findpos(const char *buffer, unsigned int depth, unsigned i
239 239
 	    return 0;
240 240
 
241 241
 	if(pattern->pattern[i] == CLI_ALT) {
242
+	    found = 0;
242 243
 	    for(j = 0; j < pattern->altn[alt]; j++) {
243 244
 		if(pattern->altc[alt][j] == buffer[bufferpos])
244 245
 		    found = 1;