From 3ae7b3aca63f8639377d856686da9711db4c2798 Mon Sep 17 00:00:00 2001 From: Tomasz Kojm Date: Mon, 28 Jan 2008 15:27:01 +0000 Subject: [PATCH] on Solaris/Intel bm_shift could be improperly allocated (bb#773) git-svn: trunk@3554 --- ChangeLog | 5 +++++ libclamav/matcher-bm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7983bfa3e..4115843fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 28 16:05:29 CET 2008 (tk) +--------------------------------- + * libclamav/matcher-bm.c: on Solaris/Intel bm_shift could be improperly + allocated (bb#773) + Sun Jan 27 20:09:35 CET 2008 (tk) --------------------------------- * libclamav/cab.c: fix memory errors in new code (bb#793) diff --git a/libclamav/matcher-bm.c b/libclamav/matcher-bm.c index b1cf27b65..2091ac329 100644 --- a/libclamav/matcher-bm.c +++ b/libclamav/matcher-bm.c @@ -95,7 +95,7 @@ int cli_bm_init(struct cli_matcher *root) uint16_t i, size = HASH(255, 255, 255) + 1; - if(!(root->bm_shift = (uint8_t *) cli_malloc(size * sizeof(uint8_t)))) + if(!(root->bm_shift = (uint8_t *) cli_calloc(size, sizeof(uint8_t)))) return CL_EMEM; if(!(root->bm_suffix = (struct cli_bm_patt **) cli_calloc(size, sizeof(struct cli_bm_patt *)))) {