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-7.0.8~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91ae28e3d357a6d206a2f6868a2b60140130d735;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 (cherry picked from commit c72404e5546635a6239bdd7302fe945f47ce1927) --- diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index 463eb2e582..2754b15567 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -332,6 +332,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, '_')) {