From: Victor Julien Date: Thu, 6 Sep 2012 11:48:55 +0000 (+0200) Subject: Make sure defrag pool sizes are not initialized to 0, see #540. X-Git-Tag: suricata-1.4beta1~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=829d975d638eca22495bfee7d57b69d83f05c054;p=thirdparty%2Fsuricata.git Make sure defrag pool sizes are not initialized to 0, see #540. --- diff --git a/src/defrag.c b/src/defrag.c index a221aa9def..3b56ee40b3 100644 --- a/src/defrag.c +++ b/src/defrag.c @@ -418,7 +418,7 @@ DefragContextNew(void) /* Initialize the pool of trackers. */ intmax_t tracker_pool_size; - if (!ConfGetInt("defrag.trackers", &tracker_pool_size)) { + if (!ConfGetInt("defrag.trackers", &tracker_pool_size) || tracker_pool_size == 0) { tracker_pool_size = DEFAULT_DEFRAG_HASH_SIZE; } dc->tracker_pool = PoolInit(tracker_pool_size, tracker_pool_size, @@ -437,7 +437,7 @@ DefragContextNew(void) /* Initialize the pool of frags. */ intmax_t frag_pool_size; - if (!ConfGetInt("defrag.max-frags", &frag_pool_size)) { + if (!ConfGetInt("defrag.max-frags", &frag_pool_size) || frag_pool_size == 0) { frag_pool_size = DEFAULT_DEFRAG_POOL_SIZE; } intmax_t frag_pool_prealloc = frag_pool_size / 2;