commit | d744e63d903ea0bbf6a4d7a80be019fb908a571f | [log] [tgz] |
---|---|---|
author | Aaron Ballman <aaron@aaronballman.com> | Fri Apr 29 20:56:48 2016 +0000 |
committer | Aaron Ballman <aaron@aaronballman.com> | Fri Apr 29 20:56:48 2016 +0000 |
tree | 57da8095f5644e02eac4cb3be72f3ee9f5e046eb | |
parent | 9190b4add8a84ec662c323cec5daf31dc1508eda [diff] [blame] |
Add a clang-tidy check that flags string-to-number conversion functions that have insufficient error checking, suggesting a better alternative. This check corresponds to: https://www.securecoding.cert.org/confluence/display/c/ERR34-C.+Detect+errors+when+converting+a+string+to+a+number llvm-svn: 268100
diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp index 4fbcc19..d5e4168 100644 --- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
@@ -20,6 +20,7 @@ #include "FloatLoopCounter.h" #include "SetLongJmpCheck.h" #include "StaticObjectExceptionCheck.h" +#include "StrToNumCheck.h" #include "ThrownExceptionTypeCheck.h" #include "VariadicFunctionDefCheck.h" @@ -64,6 +65,9 @@ // FIO CheckFactories.registerCheck<NonCopyableObjectsCheck>( "cert-fio38-c"); + // ERR + CheckFactories.registerCheck<StrToNumCheck>( + "cert-err34-c"); } };