This patch introduces a new experimental checker:
alpha.security.cert.str.51cpp
This checker is implemented based on the following rule:
https://wiki.sei.cmu.edu/confluence/x/E3s-BQ
It warns on possible std::string construction from a nullptr.
Paths
| Differential D80505
[analyzer] CERT STR rule checkers: STR51-CPP Needs RevisionPublic Authored by Charusso on May 24 2020, 9:53 PM.
Details
Summary This patch introduces a new experimental checker: This checker is implemented based on the following rule: It warns on possible std::string construction from a nullptr.
Diff Detail Event TimelineHerald added subscribers: ASDenysPetrov, martong, steakhal and 8 others. · View Herald TranscriptMay 24 2020, 9:53 PM Charusso added a parent revision: D80504: [analyzer] CERT STR rule checkers: STR50-CPP.May 24 2020, 9:56 PM Charusso marked an inline comment as done. Charusso added inline comments.
This revision now requires changes to proceed.Jun 30 2020, 5:09 AM
Revision Contents
Diff 265966 clang/docs/analyzer/checkers.rst
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
clang/lib/StaticAnalyzer/Checkers/cert/StrChecker.cpp
clang/test/Analysis/Inputs/system-header-simulator-cxx.h
clang/test/Analysis/cert/str51-cpp-false-positive-suppression.cpp
clang/test/Analysis/cert/str51-cpp.cpp
clang/test/Analysis/diagnostics/explicit-suppression.cpp
|
I support the idea that MemRegionManager should be directly accessible from CheckerContext but I would create a separate micro-patch for that. With a unit test, of course.