Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AST: create possible NULL pointer dereference if tokenlist is empty. …

…Ticket: #4630
  • Loading branch information...
commit c4419ea92048741d64b06ff2534ec491619d8b73 1 parent b9aba17
@danmar authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/tokenlist.cpp
View
4 lib/tokenlist.cpp
@@ -376,6 +376,10 @@ void TokenList::createAst()
" [ "
};
+ // No tokens => bail out
+ if (!_front)
+ return;
+
for (unsigned int i = 0; i < sizeof(operators) / sizeof(*operators); ++i) {
// TODO: extract operators to std::set - that should be faster
if (*operators[i] == '>') { // Unary operators, parse from right to left
Please sign in to comment.
Something went wrong with that request. Please try again.