clang-tools 22.0.0git
clang::tidy::cert::ProperlySeededRandomGeneratorCheck Class Reference

Random number generator must be seeded properly. More...

#include <ProperlySeededRandomGeneratorCheck.h>

Inheritance diagram for clang::tidy::cert::ProperlySeededRandomGeneratorCheck:
[legend]

Public Member Functions

 ProperlySeededRandomGeneratorCheck (StringRef Name, ClangTidyContext *Context)
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
template<class T>
void checkSeed (const MatchFinder::MatchResult &Result, const T *Func)

Detailed Description

Random number generator must be seeded properly.

A random number generator initialized with default value or a constant expression is a security vulnerability.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cert/msc51-cpp.html

Definition at line 24 of file ProperlySeededRandomGeneratorCheck.h.

Constructor & Destructor Documentation

◆ ProperlySeededRandomGeneratorCheck()

clang::tidy::cert::ProperlySeededRandomGeneratorCheck::ProperlySeededRandomGeneratorCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 18 of file ProperlySeededRandomGeneratorCheck.cpp.

Member Function Documentation

◆ check()

void clang::tidy::cert::ProperlySeededRandomGeneratorCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 78 of file ProperlySeededRandomGeneratorCheck.cpp.

◆ checkSeed()

template<class T>
void clang::tidy::cert::ProperlySeededRandomGeneratorCheck::checkSeed ( const MatchFinder::MatchResult & Result,
const T * Func )

Definition at line 94 of file ProperlySeededRandomGeneratorCheck.cpp.

◆ registerMatchers()

void clang::tidy::cert::ProperlySeededRandomGeneratorCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 31 of file ProperlySeededRandomGeneratorCheck.cpp.

◆ storeOptions()

void clang::tidy::cert::ProperlySeededRandomGeneratorCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 26 of file ProperlySeededRandomGeneratorCheck.cpp.


The documentation for this class was generated from the following files: