util-debug: fix unchecked ConfGetBool call

pull/6290/head
Juliana Fajardini 4 years ago
parent 9d24a53c53
commit 09ea412614

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation /* Copyright (C) 2007-2021 Open Information Security Foundation
* *
* You can copy, redistribute or modify this Program under the terms of * You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free * the GNU General Public License version 2 as published by the Free
@ -537,12 +537,12 @@ void SCLogErr(int x, const char *file, const char *func, const int line,
/** \brief Fatal error IF we're starting up, and configured to consider /** \brief Fatal error IF we're starting up, and configured to consider
* errors to be fatal errors */ * errors to be fatal errors */
#if !defined(__clang_analyzer__) #if !defined(__clang_analyzer__)
#define FatalErrorOnInit(x, ...) do { \ #define FatalErrorOnInit(x, ...) \
do { \
SC_ATOMIC_EXTERN(unsigned int, engine_stage); \ SC_ATOMIC_EXTERN(unsigned int, engine_stage); \
int init_errors_fatal = 0; \ int init_errors_fatal = 0; \
ConfGetBool("engine.init-failure-fatal", &init_errors_fatal); \ (void)ConfGetBool("engine.init-failure-fatal", &init_errors_fatal); \
if (init_errors_fatal && (SC_ATOMIC_GET(engine_stage) == SURICATA_INIT))\ if (init_errors_fatal && (SC_ATOMIC_GET(engine_stage) == SURICATA_INIT)) { \
{ \
SCLogError(x, __VA_ARGS__); \ SCLogError(x, __VA_ARGS__); \
exit(EXIT_FAILURE); \ exit(EXIT_FAILURE); \
} \ } \

Loading…
Cancel
Save