From e3b557809604d036af6e00c60f012c2025b59a5e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 11 Feb 2023 13:38:04 +0100 Subject: Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41, the last commit before the upstream release/17.x branch was created. --- .../Checkers/cert/InvalidPtrChecker.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp') diff --git a/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp index 084789509533..aae1a17bc0ae 100644 --- a/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp @@ -39,11 +39,11 @@ private: // SEI CERT ENV31-C const CallDescriptionMap EnvpInvalidatingFunctions = { - {{"setenv", 3}, &InvalidPtrChecker::EnvpInvalidatingCall}, - {{"unsetenv", 1}, &InvalidPtrChecker::EnvpInvalidatingCall}, - {{"putenv", 1}, &InvalidPtrChecker::EnvpInvalidatingCall}, - {{"_putenv_s", 2}, &InvalidPtrChecker::EnvpInvalidatingCall}, - {{"_wputenv_s", 2}, &InvalidPtrChecker::EnvpInvalidatingCall}, + {{{"setenv"}, 3}, &InvalidPtrChecker::EnvpInvalidatingCall}, + {{{"unsetenv"}, 1}, &InvalidPtrChecker::EnvpInvalidatingCall}, + {{{"putenv"}, 1}, &InvalidPtrChecker::EnvpInvalidatingCall}, + {{{"_putenv_s"}, 2}, &InvalidPtrChecker::EnvpInvalidatingCall}, + {{{"_wputenv_s"}, 2}, &InvalidPtrChecker::EnvpInvalidatingCall}, }; void postPreviousReturnInvalidatingCall(const CallEvent &Call, @@ -51,13 +51,15 @@ private: // SEI CERT ENV34-C const CallDescriptionMap PreviousCallInvalidatingFunctions = { - {{"getenv", 1}, &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, - {{"setlocale", 2}, + {{{"getenv"}, 1}, &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, + {{{"setlocale"}, 2}, &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, - {{"strerror", 1}, &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, - {{"localeconv", 0}, + {{{"strerror"}, 1}, + &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, + {{{"localeconv"}, 0}, + &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, + {{{"asctime"}, 1}, &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, - {{"asctime", 1}, &InvalidPtrChecker::postPreviousReturnInvalidatingCall}, }; public: -- cgit v1.2.3