15#include "../AllocationState.h"
29class PutenvWithAutoChecker :
public Checker<check::PostCall> {
31 BugType BT{
this,
"'putenv' function should not be called with auto variables",
40void PutenvWithAutoChecker::checkPostCall(
const CallEvent &
Call,
42 if (!Putenv.matches(
Call))
46 const Expr *ArgExpr =
Call.getArgExpr(0);
49 if (!isa<StackSpaceRegion>(MSR))
52 StringRef ErrorMsg =
"The 'putenv' function should not be called with "
53 "arguments that have automatic storage";
55 auto Report = std::make_unique<PathSensitiveBugReport>(BT, ErrorMsg, N);
60 C.emitReport(std::move(Report));
67bool ento::shouldRegisterPutenvWithAuto(
const CheckerManager &) {
return true; }
This represents one expression.
A CallDescription is a pattern that can be used to match calls based on the qualified name and the ar...
Represents an abstract call to a function or method along a particular path.
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemSpaceRegion * getMemorySpace() const
MemSpaceRegion - A memory region that represents a "memory space"; for example, the set of global var...
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
const MemRegion * getAsRegion() const
bool trackExpressionValue(const ExplodedNode *N, const Expr *E, PathSensitiveBugReport &R, TrackingOptions Opts={})
Attempts to add visitors to track expression value back to its point of origin.
const char *const SecurityError
The JSON file list parser is used to communicate input to InstallAPI.