Fixed Cppcheck warning; Remove unused private method CheckBufferOverrun::bufferNotZeroTerminatedError

This commit is contained in:
Daniel Marjamäki 2020-12-04 18:58:10 +01:00
parent 2530b36d9d
commit c6452adc88
2 changed files with 0 additions and 12 deletions

View File

@ -726,17 +726,6 @@ void CheckBufferOverrun::terminateStrncpyError(const Token *tok, const std::stri
"assumes buffer is null-terminated.", CWE170, true);
}
void CheckBufferOverrun::bufferNotZeroTerminatedError(const Token *tok, const std::string &varname, const std::string &function)
{
const std::string errmsg = "$symbol:" + varname + '\n' +
"$symbol:" + function + '\n' +
"The buffer '" + varname + "' is not null-terminated after the call to " + function + "().\n"
"The buffer '" + varname + "' is not null-terminated after the call to " + function + "(). "
"This will cause bugs later in the code if the code assumes the buffer is null-terminated.";
reportError(tok, Severity::warning, "bufferNotZeroTerminated", errmsg, CWE170, true);
}
//---------------------------------------------------------------------------

View File

@ -111,7 +111,6 @@ private:
void stringNotZeroTerminated();
void terminateStrncpyError(const Token *tok, const std::string &varname);
void bufferNotZeroTerminatedError(const Token *tok, const std::string &varname, const std::string &function);
void objectIndex();
void objectIndexError(const Token *tok, const ValueFlow::Value *v, bool known);