From: Alexey Simakov Date: Mon, 23 Sep 2024 18:24:48 +0000 (+0300) Subject: yaml: Add check of allocation for node object X-Git-Tag: suricata-8.0.0-beta1~835 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c72404e5546635a6239bdd7302fe945f47ce1927;p=thirdparty%2Fsuricata.git yaml: Add check of allocation for node object Fix potential dereference of nullptr in case of unsuccessful allocation of memory for list node Bug: #7270 --- diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index f8b9ae2123..f70a5f04e8 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -330,6 +330,9 @@ static int ConfYamlParse(yaml_parser_t *parser, ConfNode *parent, int inseq, int node = existing; } else { node = ConfNodeNew(); + if (unlikely(node == NULL)) { + goto fail; + } node->name = SCStrdup(value); node->parent = parent; if (node->name && strchr(node->name, '_')) {