[analyzer] Add InvalidPtrChecker
authorZurab Tsinadze <zurab.tsinadze@ericsson.com>
Sat, 18 Sep 2021 20:54:59 +0000 (22:54 +0200)
committerZurab Tsinadze <zurab.tsinadze@ericsson.com>
Mon, 4 Oct 2021 15:08:34 +0000 (17:08 +0200)
commit811b1736d91b301f59fbaa148ff55c32f90a3947
treeeb74441a4d5b74c39fab0bd163d69ef4bbbf486f
parentc63a9a79afdd9f9fd863579fd743c82ac727869b
[analyzer] Add InvalidPtrChecker

This patch introduces a new checker: `alpha.security.cert.env.InvalidPtr`

Checker finds usage of invalidated pointers related to environment.

Based on the following SEI CERT Rules:
ENV34-C: https://wiki.sei.cmu.edu/confluence/x/8tYxBQ
ENV31-C: https://wiki.sei.cmu.edu/confluence/x/5NUxBQ

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D97699
clang/docs/analyzer/checkers.rst
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp [new file with mode: 0644]
clang/test/Analysis/cert/env31-c.c [new file with mode: 0644]
clang/test/Analysis/cert/env34-c-cert-examples.c [new file with mode: 0644]
clang/test/Analysis/cert/env34-c.c [new file with mode: 0644]