]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp: fix configuration node creation
authorJason Ish <jason.ish@oisf.net>
Mon, 4 Mar 2024 21:59:09 +0000 (15:59 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 25 Mar 2024 16:36:29 +0000 (17:36 +0100)
A configuration sequence node needs to have name, which is just its
index in the sequence.

Discovered by calling ConfDump() after Suricata was fully initialized.

src/app-layer-smtp.c

index c61421cf0169b33359a58348902df13f15662684..469ea4740aba8158bbfd8b66910e7856d1cd5d35 100644 (file)
@@ -353,6 +353,10 @@ static void SMTPConfigure(void) {
             if (unlikely(seq_node->name == NULL)) {
                 FatalError("SCStrdup failure.");
             }
+            scheme->name = SCStrdup("0");
+            if (unlikely(scheme->name == NULL)) {
+                FatalError("SCStrdup failure.");
+            }
             scheme->val = SCStrdup("http://");
             if (unlikely(scheme->val == NULL)) {
                 FatalError("SCStrdup failure.");