Main Content
AUTOSAR C++14 Rule A26-5-1
Pseudorandom numbers shall not be generated using std::rand()
Description
Rule Definition
Pseudorandom numbers shall not be generated using std::rand().
Rationale
This cryptographically weak routines is predictable and must not be used for security purposes. When a predictable random value controls the execution flow, your program is vulnerable to malicious attacks.
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Algorithms library |
Category: Required, Automated |
Version History
Introduced in R2019a