]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Make sure defrag pool sizes are not initialized to 0, see #540.
authorVictor Julien <victor@inliniac.net>
Thu, 6 Sep 2012 11:48:55 +0000 (13:48 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Sep 2012 11:49:36 +0000 (13:49 +0200)
src/defrag.c

index a221aa9defb0f3a3844e95c8ae7a64915282ae76..3b56ee40b3bc9c776b495d9abdefbeb4da784436 100644 (file)
@@ -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;