]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Promote nodes set with --set to sequence nodes as needed. 839/head
authorJason Ish <jason.ish@emulex.com>
Mon, 10 Feb 2014 20:47:43 +0000 (14:47 -0600)
committerJason Ish <jason.ish@emulex.com>
Mon, 10 Feb 2014 20:47:43 +0000 (14:47 -0600)
A node isn't known to be a sequence node until the YAML is parsed.
If a node sequence node was set on the command line, promote
it to a sequence node when it is discovered by YAML to be
a sequence node.

Fixes comment #18 in issue 921.

src/conf-yaml-loader.c

index 500e3de6f4d8986d79f04f9cbe94538326e16a85..8e873079432fae01e6aa915a55164b998ec68962 100644 (file)
@@ -340,8 +340,8 @@ ConfYamlParse(yaml_parser_t *parser, ConfNode *parent, int inseq)
                         SCFree(seq_node);
                         return -1;
                     }
-                    seq_node->is_seq = 1;
                 }
+                seq_node->is_seq = 1;
                 TAILQ_INSERT_TAIL(&node->head, seq_node, next);
                 if (ConfYamlParse(parser, seq_node, 0) != 0)
                     goto fail;