From f9213d7cc67cacef6b234fb105a08806f7f394ad Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 26 Feb 2014 15:18:26 +0100 Subject: [PATCH] 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. --- src/stream-tcp-reassemble.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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]); -- 2.47.2