]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mpm/ac: use FatalError instead of Critical and exit
authorVictor Julien <vjulien@oisf.net>
Thu, 1 Dec 2022 12:01:54 +0000 (13:01 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 20 Dec 2022 07:51:33 +0000 (08:51 +0100)
src/util-mpm-ac-bs.c
src/util-mpm-ac-ks.c
src/util-mpm-ac.c

index d48ec11b99d0cdbd26e355ec3185bf71cdb08b40..3d6b7f0cbb4c6ead26d38d519abaae42cd303712 100644 (file)
@@ -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)
 
index 771b8a9371d7c01ca214bd4456f861021ab4c1d5..983345b9884dff8810c66a0a624f634c4739b741 100644 (file)
@@ -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++];
index fae8b83f16bd406d309245280d84c1c2b300c014..0365cb3013f659a32c494458f8c27ce1861d7c7a 100644 (file)
@@ -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)