summaryrefslogtreecommitdiffstats
path: root/src/conf-yaml-loader.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-24 01:56:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-24 01:56:35 +0000
commit2d761821036c1180e5f101d68cf850f536840469 (patch)
tree293f224b9f02aa85a66c7969e83d62572ebb1088 /src/conf-yaml-loader.c
parentAdding debian version 1:7.0.4-1. (diff)
downloadsuricata-2d761821036c1180e5f101d68cf850f536840469.tar.xz
suricata-2d761821036c1180e5f101d68cf850f536840469.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.c15
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