From 7251c2d8bc77a592ff71cfcf5ae66c444cca4553 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sun, 21 Apr 2019 01:58:42 +0000 Subject: 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. Obtained from: https://github.com/davidchisnall/dtc/commit/e5ecf9319fd3f MFC after: 3 days --- usr.bin/dtc/fdt.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.bin/dtc') diff --git a/usr.bin/dtc/fdt.cc b/usr.bin/dtc/fdt.cc index fa4125ffe6ef..a1e2fc4dbf2d 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 { -- cgit v1.2.3