Browse code

on Solaris/Intel bm_shift could be improperly allocated (bb#773)

git-svn: trunk@3554

Tomasz Kojm authored on 2008/01/29 00:27:01
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Mon Jan 28 16:05:29 CET 2008 (tk)
2
+---------------------------------
3
+  * libclamav/matcher-bm.c: on Solaris/Intel bm_shift could be improperly
4
+			    allocated (bb#773)
5
+
1 6
 Sun Jan 27 20:09:35 CET 2008 (tk)
2 7
 ---------------------------------
3 8
   * libclamav/cab.c: fix memory errors in new code (bb#793)
... ...
@@ -95,7 +95,7 @@ int cli_bm_init(struct cli_matcher *root)
95 95
 	uint16_t i, size = HASH(255, 255, 255) + 1;
96 96
 
97 97
 
98
-    if(!(root->bm_shift = (uint8_t *) cli_malloc(size * sizeof(uint8_t))))
98
+    if(!(root->bm_shift = (uint8_t *) cli_calloc(size, sizeof(uint8_t))))
99 99
 	return CL_EMEM;
100 100
 
101 101
     if(!(root->bm_suffix = (struct cli_bm_patt **) cli_calloc(size, sizeof(struct cli_bm_patt *)))) {