Project

General

Profile

Actions

Bug #7270

closed

yaml: Possible dereference of nullptr in case of unsuccess allocation of memory for node in yaml parser

Added by Alexey Simakov about 1 month ago. Updated 15 days 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: yaml: Possible dereference of nullptr in case of unsuccess allocation of memory for node in yaml parser (7.0.x backport)ClosedJuliana Fajardini ReichowActions
Actions #1

Updated by Jason Ish about 1 month ago

  • Status changed from New to In Review
Actions #2

Updated by Jason Ish about 1 month ago

  • Label Needs backport to 7.0 added
Actions #3

Updated by Philippe Antoine about 1 month ago

  • Target version changed from TBD to 8.0.0-beta1
Actions #4

Updated by OISF Ticketbot about 1 month ago

  • Subtask #7294 added
Actions #5

Updated by OISF Ticketbot about 1 month ago

  • Label deleted (Needs backport to 7.0)
Actions #6

Updated by Juliana Fajardini Reichow 16 days ago

  • Status changed from In Review to Resolved
Actions #7

Updated by Juliana Fajardini Reichow 15 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF