Fix segmentation fault with --errorlist

This commit is contained in:
Reijo Tomperi 2009-10-17 21:13:09 +03:00
parent cb76061118
commit 4e9f4d4abc
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ void CheckBufferOverrun::bufferOverrun(const Token *tok)
void CheckBufferOverrun::dangerousStdCin(const Token *tok)
{
if (_settings->_showAll == false)
if (_settings && _settings->_showAll == false)
return;
reportError(tok, Severity::possibleError, "dangerousStdCin", "Dangerous usage of std::cin, possible buffer overrun");
@ -101,7 +101,7 @@ void CheckBufferOverrun::dangerousStdCin(const Token *tok)
void CheckBufferOverrun::strncatUsage(const Token *tok)
{
if (_settings->_showAll == false)
if (_settings && _settings->_showAll == false)
return;
reportError(tok, Severity::possibleError, "strncatUsage", "Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append");
@ -114,7 +114,7 @@ void CheckBufferOverrun::outOfBounds(const Token *tok, const std::string &what)
void CheckBufferOverrun::sizeArgumentAsChar(const Token *tok)
{
if (_settings->_showAll == false)
if (_settings && _settings->_showAll == false)
return;
reportError(tok, Severity::possibleError, "sizeArgumentAsChar", "The size argument is given as a char constant");