Fix null pointer deref in AST traversal

Specifically in the case where parsing bro scripts had failed.
This commit is contained in:
Jon Siwek 2018-06-22 20:17:06 -05:00
parent 2470954795
commit e93c638f8d
3 changed files with 11 additions and 1 deletions

View file

@ -9,6 +9,10 @@ TraversalCode traverse_all(TraversalCallback* cb)
if ( ! global_scope() )
return TC_CONTINUE;
if ( ! stmts )
// May be null when parsing fails.
return TC_CONTINUE;
cb->current_scope = global_scope();
TraversalCode tc = global_scope()->Traverse(cb);