From: Victor Julien Date: Sun, 15 Oct 2017 19:25:07 +0000 (+0200) Subject: output: harden output deinit X-Git-Tag: suricata-4.0.1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f6fbf94db0d8f9852ac5c1abc5d4706c8742f79;p=thirdparty%2Fsuricata.git output: harden output deinit If thread setup fails allow output deinit code to be called with NULL data without crashing. --- diff --git a/src/output.c b/src/output.c index 4919c3c0a2..2c8516f095 100644 --- a/src/output.c +++ b/src/output.c @@ -953,6 +953,9 @@ TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data TmEcode OutputLoggerThreadDeinit(ThreadVars *tv, void *thread_data) { + if (thread_data == NULL) + return TM_ECODE_FAILED; + LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data; RootLogger *logger = TAILQ_FIRST(&RootLoggers); LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);