From: Victor Julien Date: Wed, 26 Feb 2014 14:18:26 +0000 (+0100) Subject: stream-tcp: proper error if segment pool init fails X-Git-Tag: suricata-2.0rc2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F855%2Fhead;p=thirdparty%2Fsuricata.git stream-tcp: proper error if segment pool init fails Until now a PoolInit failure for the segment pools would result in an abort() through BUG_ON(). This patch adds a proper error message, then exits. Bug #1108. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 4c9baaba52..386eb96ba2 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -411,7 +411,12 @@ int StreamTcpReassemblyConfig(char quiet) (void *) &my_segment_pktsizes[i], TcpSegmentPoolCleanup, NULL); SCMutexUnlock(&my_segment_lock[i]); - BUG_ON(my_segment_pool[i] == NULL); + + if (my_segment_pool[i] == NULL) { + SCLogError(SC_ERR_INITIALIZATION, "couldn't set up segment pool " + "for packet size %u. Memcap too low?", my_segment_pktsizes[i]); + exit(EXIT_FAILURE); + } SCLogDebug("my_segment_pktsizes[i] %u, my_segment_poolsizes[i] %u", my_segment_pktsizes[i], my_segment_poolsizes[i]);