Project

General

Profile

Actions

Bug #7270

closed
AS AS

conf: nullptr dereference if mem alloc fails for a node in yaml parser

Bug #7270: conf: nullptr dereference if mem alloc fails for a node in yaml parser

Added by Alexey Simakov over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
low
Difficulty:
low
Label:
Beginner

Description

conf-yaml-loader.c:334 is instruction with allocation of new node, which could return nullptr in case of unsuccessful allocation and this could potentially lead to dereference of nullptr in some(pretty rare) cases

ConfNode *existing = ConfNodeLookupChild(parent, value);
                        if (existing != NULL) {
                            if (!existing->final) {
                                SCLogInfo("Configuration node '%s' redefined.", existing->name);
                                ConfNodePrune(existing);
                            }
                            node = existing;
                        } else {
                            node = ConfNodeNew(); <---- Allocation result is not checked
                            node->name = SCStrdup(value);
                            node->parent = parent;

Subtasks 1 (0 open1 closed)

Bug #7294: conf: nullptr dereference if mem alloc fails for a node in yaml parser (7.0.x backport)ClosedJuliana Fajardini ReichowActions

JI Updated by Jason Ish over 1 year ago Actions #1

  • Status changed from New to In Review

JI Updated by Jason Ish over 1 year ago Actions #2

  • Label Needs backport to 7.0 added

PA Updated by Philippe Antoine over 1 year ago Actions #3

  • Target version changed from TBD to 8.0.0-beta1

OT Updated by OISF Ticketbot over 1 year ago Actions #4

  • Subtask #7294 added

OT Updated by OISF Ticketbot over 1 year ago Actions #5

  • Label deleted (Needs backport to 7.0)

JF Updated by Juliana Fajardini Reichow over 1 year ago Actions #6

  • Status changed from In Review to Resolved

JF Updated by Juliana Fajardini Reichow over 1 year ago Actions #7

  • Status changed from Resolved to Closed

JF Updated by Juliana Fajardini Reichow over 1 year ago Actions #8

  • Subject changed from yaml: Possible dereference of nullptr in case of unsuccess allocation of memory for node in yaml parser to conf: nullptr dereference if mem alloc fails for a node in yaml parser
Actions

Also available in: PDF Atom