detect/port: add BUG_ON on impossible condition

to assist Coverity in assessing the state of x correctly.
pull/13710/head
Shivani Bhardwaj 3 months ago committed by Victor Julien
parent e54dd8d814
commit 982c9222dd

@ -807,6 +807,7 @@ static int DetectPortParseDo(const DetectEngineCtx *de_ctx,
} else if (!o_set && s[u] == '!') { } else if (!o_set && s[u] == '!') {
SCLogDebug("negation encountered"); SCLogDebug("negation encountered");
n_set = 1; n_set = 1;
BUG_ON(x == 0); /* always false; added to guide static code analyzers like Coverity */
x--; x--;
} else if (s[u] == '[') { } else if (s[u] == '[') {
if (!o_set) { if (!o_set) {

Loading…
Cancel
Save