aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/dtc
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-04-21 01:58:42 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-04-21 01:58:42 +0000
commit7251c2d8bc77a592ff71cfcf5ae66c444cca4553 (patch)
tree2fb49b8c390338e889bfe55587ba47de24d620cb /usr.bin/dtc
parentde2a04f2e2fe85573b87a24daf60e2fd3a82a835 (diff)
downloadsrc-7251c2d8bc77a592ff71cfcf5ae66c444cca4553.tar.gz
src-7251c2d8bc77a592ff71cfcf5ae66c444cca4553.zip
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
Notes
Notes: svn path=/head/; revision=346469
Diffstat (limited to 'usr.bin/dtc')
-rw-r--r--usr.bin/dtc/fdt.cc5
1 files changed, 4 insertions, 1 deletions
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
{