Skip to content

Commit

Permalink
Fix segfault when errors happen while compiling a path-ref node
Browse files Browse the repository at this point in the history
node::parse will return 0 instead of a valid pointer if the node it parsed was
ultimately not valid.  This bit failed to check for that.
  • Loading branch information
kevans91 authored and davidchisnall committed Apr 11, 2019
1 parent c431171 commit e5ecf93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fdt.cc
Expand Up @@ -1622,7 +1622,10 @@ device_tree::parse_file(text_input_buffer &input,
} }
input.next_token(); input.next_token();
n = node::parse(input, *this, std::move(name), string_set(), string(), &defines); 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 else
{ {
Expand Down

0 comments on commit e5ecf93

Please sign in to comment.