From: Shivani Bhardwaj Date: Tue, 21 Nov 2023 08:23:09 +0000 (+0530) Subject: detect/port: remove BUG_ON in favor of PORT_ER X-Git-Tag: suricata-8.0.0-beta1~1982 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8960a86f4fcc2e306fbf4de9a2b4550a7e8a35d3;p=thirdparty%2Fsuricata.git detect/port: remove BUG_ON in favor of PORT_ER Either the BUG_ON condition would hit or PORT_ER. Prefer to return error in case of an error as the fn expects that. --- diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index 04d2a49d55..86a367d376 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -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;