...
Code Block | ||
---|---|---|
| ||
#include<Wincrypt.h>
HCRYPTPROV hCryptProv;
union {
BYTE bs[sizeof(long int)];
long int li;
} rand_buf;
if (!CryptGenRandom(hCryptProv, sizeof(rand_buf), &rand_buf) {
/* Handle error */
} else {
printf("Random number: %ld\n", rand_buf.li);
}
|
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MSC30-C | 1 ( low ) 1 ( | unlikely ) | 1 ( high ) | P1 | L3 |
Automated Detection
The LDRA tool suite V 7.6.0 is able to detect violations of this rule.
...