From: Philippe Antoine Date: Tue, 8 Oct 2024 11:51:32 +0000 (+0200) Subject: http: fix condition check X-Git-Tag: suricata-7.0.8~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5c4dc39444455b58efafa18289f826149fc18c6;p=thirdparty%2Fsuricata.git http: fix condition check Ticket: 7309 Do not use a constant expression in a condition (cherry picked from commit 76527dde79a5825299c9534e8da1fabb7fb4279e) --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index a02d9202aa..84cfd2148c 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -1357,7 +1357,7 @@ static void FlagDetectStateNewFile(HtpTxUserData *tx, int dir) if (dir == STREAM_TOSERVER) { SCLogDebug("DETECT_ENGINE_STATE_FLAG_FILE_NEW set"); tx->tx_data.de_state->dir_state[0].flags |= DETECT_ENGINE_STATE_FLAG_FILE_NEW; - } else if (STREAM_TOCLIENT) { + } else if (dir == STREAM_TOCLIENT) { SCLogDebug("DETECT_ENGINE_STATE_FLAG_FILE_NEW set"); tx->tx_data.de_state->dir_state[1].flags |= DETECT_ENGINE_STATE_FLAG_FILE_NEW; }