]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: config checks alstate before getting tx 7242/head
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 8 Apr 2022 13:15:23 +0000 (15:15 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 14 Apr 2022 20:51:40 +0000 (22:51 +0200)
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

index 0f06b9a66b9693a504be485d6e73e256e9aa9f8a..dfd39998ddfa818f9652bac160f4990c1e41c616 100644 (file)
@@ -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);