Browse code

libclamav: matcher-bm: fix node sorting

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@730 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/08/07 08:43:50
Showing 2 changed files
... ...
@@ -1,10 +1,15 @@
1
+Sat Aug  7 01:33:14 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav: matcher-bm: fix node sorting (false negative example provided
4

                
5
+
1 6
 Fri Aug  6 11:09:22 BST 2004 (njh)
2 7
 ----------------------------------
3 8
   * clamav-milter:	Quarantined file's names now contain the name of the
4 9
 				virus
5 10
 			Handle crash when --bounce is set, and MAIL FROM isn't
6 11
 				sent in an e-mail containing a virus.
7
-				Fix by "Denis Ustimenko" <den@uzsci.net>
12
+				Fix by "Denis Ustimenko" <den*uzsci.net>
8 13
 
9 14
 Thu Aug  5 19:53:40 CEST 2004 (tk)
10 15
 ----------------------------------
... ...
@@ -26,8 +31,8 @@ Thu Aug  5 08:44:51 BST 2004 (njh)
26 26
 				sendmail variables are now delimeted by
27 27
 				dollars, e.g.  ${j}$
28 28
 			Better local IP table by Damian Menscher
29
-				<menscher@uiuc.edu> and Andy Fiddaman
30
-				<clam@fiddaman.net>
29
+				<menscher*uiuc.edu> and Andy Fiddaman
30
+				<clam*fiddaman.net>
31 31
 
32 32
 Thu Aug  5 03:10:32 CEST 2004 (tk)
33 33
 ----------------------------------
... ...
@@ -52,7 +52,7 @@ int cli_bm_addpatt(struct cl_node *root, struct cli_bm_patt *pattern)
52 52
     prev = next = root->bm_suffix[idx];
53 53
 
54 54
     while(next) {
55
-	if(next->pattern[0] >= pt[0])
55
+	if(pt[0] > next->pattern[0])
56 56
 	    break;
57 57
 	prev = next;
58 58
 	next = next->next;
... ...
@@ -118,7 +118,7 @@ void cli_bm_free(struct cl_node *root)
118 118
 
119 119
 int cli_bm_scanbuff(const char *buffer, unsigned int length, const char **virname, const struct cl_node *root)
120 120
 {
121
-	int i, j, shift, off, found;
121
+	int i, j, shift, off, found = 0;
122 122
 	uint16_t idx;
123 123
 	struct cli_bm_patt *p;
124 124
 	const char *bp;
... ...
@@ -151,12 +151,14 @@ int cli_bm_scanbuff(const char *buffer, unsigned int length, const char **virnam
151 151
 			break;
152 152
 		    }
153 153
 		}
154
+
154 155
 		if(found && p->length == j) {
155 156
 		    if(virname)
156 157
 			*virname = p->virname;
157 158
 
158 159
 		    return CL_VIRUS;
159 160
 		}
161
+
160 162
 		p = p->next;
161 163
 	    }
162 164