Browse code

fix boundary error (bb#491)

git-svn: trunk@3049

Tomasz Kojm authored on 2007/05/02 18:17:46
Showing 2 changed files
... ...
@@ -1,6 +1,10 @@
1
+Wed May  2 10:30:39 CEST 2007 (tk)
2
+----------------------------------
3
+  * libclamav/matcher-ac.c: fix boundary error (bb#491)
4
+
1 5
 Tue May  1 22:26:00 EEST 2007 (edwin)
2 6
 ----------------------------------
3
-  libclamav/htmlnorm.c: fix uninitialized value warning
7
+  * libclamav/htmlnorm.c: fix uninitialized value warning
4 8
 
5 9
 Tue May  1 18:13:09 BST 2007 (njh)
6 10
 ----------------------------------
... ...
@@ -334,6 +334,9 @@ inline static int ac_findmatch(const unsigned char *buffer, uint32_t offset, uin
334 334
 	uint8_t found;
335 335
 
336 336
 
337
+    if(offset + pattern->length > length)
338
+	return 0;
339
+
337 340
     if(pattern->prefix)
338 341
 	if(pattern->prefix_length > offset)
339 342
 	    return 0;