Files
clang-p2996/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
Balazs Benics a49cf6c14a [analyzer] Fix "sprintf" parameter modeling in CStringChecker
`CE->getCalleeDecl()` returns `VarDecl` if the callee is actually a
function pointer variable. Consequently, calling `getAsFunction()` will
return null.

To workaround the case, we should use the `CallEvent::parameters()`,
which will internally recover the function being called and do the right
thing.

Fixes #74269
Depends on "[analyzer][NFC] Prefer CallEvent over CallExpr in APIs"
2023-12-28 16:06:21 +01:00

105 KiB