From f33784bed303142958c0021ac735aabc6640b9cc Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 1 Dec 2022 13:01:54 +0100 Subject: [PATCH] mpm/ac: use FatalError instead of Critical and exit --- src/util-mpm-ac-bs.c | 16 +++++++--------- src/util-mpm-ac-ks.c | 10 ++++------ src/util-mpm-ac.c | 14 +++++--------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/util-mpm-ac-bs.c b/src/util-mpm-ac-bs.c index d48ec11b99..3d6b7f0cbb 100644 --- a/src/util-mpm-ac-bs.c +++ b/src/util-mpm-ac-bs.c @@ -310,9 +310,8 @@ static inline void SCACBSEnqueue(StateQueue *q, int32_t state) q->top = 0; if (q->top == q->bot) { - SCLogCritical("Just ran out of space in the queue. " - "Fatal Error. Exiting. Please file a bug report on this"); - exit(EXIT_FAILURE); + FatalError("Just ran out of space in the queue. " + "Fatal Error. Exiting. Please file a bug report on this"); } return; @@ -324,9 +323,8 @@ static inline int32_t SCACBSDequeue(StateQueue *q) q->bot = 0; if (q->bot == q->top) { - SCLogCritical("StateQueue behaving weirdly. " - "Fatal Error. Exiting. Please file a bug report on this"); - exit(EXIT_FAILURE); + FatalError("StateQueue behaving weirdly. " + "Fatal Error. Exiting. Please file a bug report on this"); } return q->store[q->bot++]; @@ -349,9 +347,9 @@ static inline int32_t SCACBSDequeue(StateQueue *q) (q)->top = 0; \ \ if ((q)->top == (q)->bot) { \ - SCLogCritical(SC_ERR_AHO_CORASICK, "Just ran out of space in the queue. " \ - "Fatal Error. Exiting. Please file a bug report on this"); \ - exit(EXIT_FAILURE); \ + FatalError("Just ran out of space in the queue. " \ + "Fatal Error. Exiting. Please file a bug report on +this"); \ } \ } while (0) diff --git a/src/util-mpm-ac-ks.c b/src/util-mpm-ac-ks.c index 771b8a9371..983345b988 100644 --- a/src/util-mpm-ac-ks.c +++ b/src/util-mpm-ac-ks.c @@ -427,9 +427,8 @@ static inline void SCACTileEnqueue(StateQueue *q, int32_t state) q->top = 0; if (q->top == q->bot) { - SCLogCritical("Just ran out of space in the queue. " - "Fatal Error. Exiting. Please file a bug report on this"); - exit(EXIT_FAILURE); + FatalError("Just ran out of space in the queue. " + "Fatal Error. Exiting. Please file a bug report on this"); } } @@ -439,9 +438,8 @@ static inline int32_t SCACTileDequeue(StateQueue *q) q->bot = 0; if (q->bot == q->top) { - SCLogCritical("StateQueue behaving weirdly. " - "Fatal Error. Exiting. Please file a bug report on this"); - exit(EXIT_FAILURE); + FatalError("StateQueue behaving weirdly. " + "Fatal Error. Exiting. Please file a bug report on this"); } return q->store[q->bot++]; diff --git a/src/util-mpm-ac.c b/src/util-mpm-ac.c index fae8b83f16..0365cb3013 100644 --- a/src/util-mpm-ac.c +++ b/src/util-mpm-ac.c @@ -395,9 +395,7 @@ static inline void SCACEnqueue(StateQueue *q, int32_t state) q->top = 0; if (q->top == q->bot) { - SCLogCritical("Just ran out of space in the queue. " - "Fatal Error. Exiting. Please file a bug report on this"); - exit(EXIT_FAILURE); + FatalError("Just ran out of space in the queue. Please file a bug report on this"); } return; @@ -409,9 +407,7 @@ static inline int32_t SCACDequeue(StateQueue *q) q->bot = 0; if (q->bot == q->top) { - SCLogCritical("StateQueue behaving weirdly. " - "Fatal Error. Exiting. Please file a bug report on this"); - exit(EXIT_FAILURE); + FatalError("StateQueue behaving weirdly. Please file a bug report on this"); } return q->store[q->bot++]; @@ -434,9 +430,9 @@ static inline int32_t SCACDequeue(StateQueue *q) (q)->top = 0; \ \ if ((q)->top == (q)->bot) { \ - SCLogCritical(SC_ERR_AHO_CORASICK, "Just ran out of space in the queue. " \ - "Fatal Error. Exiting. Please file a bug report on this"); \ - exit(EXIT_FAILURE); \ + FatalError("Just ran out of space in the queue. " \ + "Fatal Error. Exiting. Please file a bug report on +this"); \ } \ } while (0)