diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-24 01:56:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-24 01:56:37 +0000 |
commit | 8f4cc1aaed27bf561cad096d47c24903421c7ab7 (patch) | |
tree | 9f8ecf92240a8ef68527ec4b4349e0950d23dc3a /src/conf-yaml-loader.c | |
parent | Releasing progress-linux version 1:7.0.4-1~progress7.99u1. (diff) | |
download | suricata-8f4cc1aaed27bf561cad096d47c24903421c7ab7.tar.xz suricata-8f4cc1aaed27bf561cad096d47c24903421c7ab7.zip |
Merging upstream version 1:7.0.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/conf-yaml-loader.c')
-rw-r--r-- | src/conf-yaml-loader.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index ea64563..463eb2e 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -394,8 +394,19 @@ static int ConfYamlParse(yaml_parser_t *parser, ConfNode *parent, int inseq, int if (inseq) { char sequence_node_name[DEFAULT_NAME_LEN]; snprintf(sequence_node_name, DEFAULT_NAME_LEN, "%d", seq_idx++); - ConfNode *seq_node = ConfNodeLookupChild(node, - sequence_node_name); + ConfNode *seq_node = NULL; + if (was_empty < 0) { + // initialize was_empty + if (TAILQ_EMPTY(&node->head)) { + was_empty = 1; + } else { + was_empty = 0; + } + } + // we only check if the node's list was not empty at first + if (was_empty == 0) { + seq_node = ConfNodeLookupChild(node, sequence_node_name); + } if (seq_node != NULL) { /* The sequence node has already been set, probably * from the command line. Remove it so it gets |