]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/port: remove BUG_ON in favor of PORT_ER
authorShivani Bhardwaj <shivani@oisf.net>
Tue, 21 Nov 2023 08:23:09 +0000 (13:53 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Dec 2023 10:33:09 +0000 (11:33 +0100)
Either the BUG_ON condition would hit or PORT_ER. Prefer to return error
in case of an error as the fn expects that.

src/detect-engine-port.c

index 04d2a49d557f9f9bea200cced87d15657cc9ca40..86a367d376cd7063306784f577cfc59ead3bb7fd 100644 (file)
@@ -594,9 +594,6 @@ int DetectPortCmp(DetectPort *a, DetectPort *b)
     } else if (a_port1 > b_port2) {
         //SCLogDebug("PORT_GT");
         return PORT_GT;
-    } else {
-        /* should be unreachable */
-        BUG_ON(1);
     }
 
     return PORT_ER;