From c8a43f82e540339ae511802c628e541079c5b566 Mon Sep 17 00:00:00 2001 From: kevans Date: Sat, 27 Apr 2019 04:16:15 +0000 Subject: [PATCH] MFC r346469: dtc(1): Pull in fix for segfault-upon-error condition Specifically, parse errors within a node would lead to a segfault due to an unconditional dereference after emitting the error. --- usr.bin/dtc/fdt.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/dtc/fdt.cc b/usr.bin/dtc/fdt.cc index fa4125ffe6e..a1e2fc4dbf2 100644 --- a/usr.bin/dtc/fdt.cc +++ b/usr.bin/dtc/fdt.cc @@ -1622,7 +1622,10 @@ device_tree::parse_file(text_input_buffer &input, } input.next_token(); n = node::parse(input, *this, std::move(name), string_set(), string(), &defines); - n->name_is_path_reference = name_is_path_reference; + if (n) + { + n->name_is_path_reference = name_is_path_reference; + } } else { -- 2.45.0