| 1208 | } |
| 1209 | |
| 1210 | void CheckBufferOverrunImpl::negativeMemoryAllocationSizeError(const Token* tok, const ValueFlow::Value* value) |
| 1211 | { |
| 1212 | const std::string msg = "Memory allocation size is negative."; |
| 1213 | ErrorPath errorPath = getErrorPath(tok, value, msg); |
| 1214 | const bool inconclusive = value != nullptr && !value->isKnown(); |
| 1215 | reportError(std::move(errorPath), inconclusive ? Severity::warning : Severity::error, "negativeMemoryAllocationSize", |
| 1216 | msg, CWE131, inconclusive ? Certainty::inconclusive : Certainty::normal); |
| 1217 | } |
| 1218 | |
| 1219 | void CheckBufferOverrun::runChecks(const Tokenizer &tokenizer, ErrorLogger& errorLogger) |
| 1220 | { |
no test coverage detected