aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/cert/CERTTidyModule.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2016-11-02 14:16:36 +0000
committerAaron Ballman <aaron@aaronballman.com>2016-11-02 14:16:36 +0000
commit7b7f5caa6d17269c30054528a5d4d14775f8dd79 (patch)
treef0e92e0eebf250e5c8a20960998e3249e3119a4b /clang-tidy/cert/CERTTidyModule.cpp
parentc9bdecfcf90ad53bbe054c5a0233b76e63c60fa8 (diff)
Add a new clang-tidy check for cert-msc50-cpp (and cert-msc30-c) that corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/MSC50-CPP.+Do+not+use+std%3A%3Arand%28%29+for+generating+pseudorandom+numbers
Patch by Benedek Kiss git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@285809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/cert/CERTTidyModule.cpp')
-rw-r--r--clang-tidy/cert/CERTTidyModule.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang-tidy/cert/CERTTidyModule.cpp b/clang-tidy/cert/CERTTidyModule.cpp
index c44d6eeb..71135378 100644
--- a/clang-tidy/cert/CERTTidyModule.cpp
+++ b/clang-tidy/cert/CERTTidyModule.cpp
@@ -18,6 +18,7 @@
#include "../misc/ThrowByValueCatchByReferenceCheck.h"
#include "CommandProcessorCheck.h"
#include "FloatLoopCounter.h"
+#include "LimitedRandomnessCheck.h"
#include "SetLongJmpCheck.h"
#include "StaticObjectExceptionCheck.h"
#include "StrToNumCheck.h"
@@ -53,6 +54,9 @@ public:
"cert-err60-cpp");
CheckFactories.registerCheck<misc::ThrowByValueCatchByReferenceCheck>(
"cert-err61-cpp");
+ // MSC
+ CheckFactories.registerCheck<LimitedRandomnessCheck>(
+ "cert-msc50-cpp");
// C checkers
// DCL
@@ -70,6 +74,9 @@ public:
// ERR
CheckFactories.registerCheck<StrToNumCheck>(
"cert-err34-c");
+ // MSC
+ CheckFactories.registerCheck<LimitedRandomnessCheck>(
+ "cert-msc30-c");
}
ClangTidyOptions getModuleOptions() override {
ClangTidyOptions Options;