From 30c86f7107728106419067d12d06bfd440622645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 22 Dec 2008 18:00:54 +0000 Subject: [PATCH] simplifyIfAddBraces : Fixed segmentation fault --- tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokenize.cpp b/tokenize.cpp index 49e93fc16..8dec11cac 100644 --- a/tokenize.cpp +++ b/tokenize.cpp @@ -1220,7 +1220,7 @@ bool Tokenizer::simplifyIfAddBraces() { bool ret = false; - for ( TOKEN *tok = _tokens; tok; tok = tok->next() ) + for ( TOKEN *tok = _tokens; tok; tok = tok ? tok->next() : NULL ) { if ( ! TOKEN::Match(tok, "if|for|while (") ) continue;