From dccf2e4c30b968477d9cc7e7a86b64b97893831c Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 8 Apr 2022 15:15:23 +0200 Subject: [PATCH] detect: config checks alstate before getting tx Ticket: 4972 As is done in detect-lua-extensions. We can have a flow with alproto unknown, no state, and therefore cannot run AppLayerParserGetTx which could try to run a NULL function --- src/detect-config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/detect-config.c b/src/detect-config.c index 0f06b9a66b..dfd39998dd 100644 --- a/src/detect-config.c +++ b/src/detect-config.c @@ -89,6 +89,9 @@ void DetectConfigRegister(void) static void ConfigApplyTx(Flow *f, const uint64_t tx_id, const DetectConfigData *config) { + if (f->alstate == NULL) { + return; + } void *tx = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, tx_id); if (tx) { AppLayerTxData *txd = AppLayerParserGetTxData(f->proto, f->alproto, tx); -- 2.47.2