[all-commits] [llvm/llvm-project] f7a46d: [analyzer][clangsa] Add new option to alpha.securi...

Endre Fülöp via All-commits all-commits at lists.llvm.org
Tue Oct 24 05:00:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f7a46d700f6458a382304339c5b3589bf30ae45d
      https://github.com/llvm/llvm-project/commit/f7a46d700f6458a382304339c5b3589bf30ae45d
  Author: Endre Fülöp <endre.fulop at sigmatechnology.se>
  Date:   2023-10-24 (Tue, 24 Oct 2023)

  Changed paths:
    M clang/docs/analyzer/checkers.rst
    M clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    M clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp
    M clang/test/Analysis/analyzer-config.c
    M clang/test/Analysis/cert/env34-c-cert-examples.c
    M clang/test/Analysis/cert/env34-c.c
    A clang/test/Analysis/invalid-ptr-checker.c

  Log Message:
  -----------
  [analyzer][clangsa] Add new option to alpha.security.cert.InvalidPtrChecker (#67663)

Introduce 'InvalidatingGetEnv' checker option for 'getenv' calls.

- POSIX suggests consecutive 'getenv' calls may invalidate 
  pointer pointers. This is often too strict in real-world scenarios.
- New 'InvalidatingGetEnv' checker option provides a more 
  pragmatic default that doesn't treat consecutive 'getenv' 
  calls as invalidating.
- Now also handles main function specifications with an 
  environment pointer as the third parameter.

Original Phabricator review:
https://reviews.llvm.org/D154603




More information about the All-commits mailing list