From 155487e79d84d43b2d6bba7bde0870cca310bcbe Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 28 Apr 2025 10:56:54 +0200 Subject: [PATCH] detect: do not bug on tx data being NULL Ticket: 7610 As this can happen for HTTP1 in Suricata 7 This was fixed in Suricata 8 by f301cd370205af7e069680c286252304ab128214 and 833a738dd1429f63c79d95edf25bb86fcc15b51a from ticket 5739 --- src/detect-engine-state.c | 2 -- src/detect-filestore.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index 6fd7f96e58..2d7387b2c9 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -228,7 +228,6 @@ void DetectRunStoreStateTx( const uint16_t file_no_match) { AppLayerTxData *tx_data = AppLayerParserGetTxData(f->proto, f->alproto, tx); - BUG_ON(tx_data == NULL); if (tx_data == NULL) { SCLogDebug("No TX data for %" PRIu64, tx_id); return; @@ -284,7 +283,6 @@ void DetectEngineStateResetTxs(Flow *f) void *inspect_tx = AppLayerParserGetTx(f->proto, f->alproto, alstate, inspect_tx_id); if (inspect_tx != NULL) { AppLayerTxData *txd = AppLayerParserGetTxData(f->proto, f->alproto, inspect_tx); - BUG_ON(txd == NULL); if (txd) { ResetTxState(txd->de_state); } diff --git a/src/detect-filestore.c b/src/detect-filestore.c index c905f9b88d..d110efce7d 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -159,7 +159,6 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, const DetectFilesto DEBUG_VALIDATE_BUG_ON(txv == NULL); if (txv != NULL) { AppLayerTxData *txd = AppLayerParserGetTxData(f->proto, f->alproto, txv); - DEBUG_VALIDATE_BUG_ON(txd == NULL); if (txd != NULL) { if (toclient_dir) { txd->file_flags |= FLOWFILE_STORE_TC; -- 2.47.2