...
Code Block | ||
---|---|---|
| ||
#include <sys/resource.h>
/* ... */
struct rlimit limit;
limit.rlim_cur = 0;
limit.rlim_max = 0;
if (setrlimit(RLIMIT_CORE, &limit) != 0) {
/* Handle Error */
}
/* Create or otherwise obtain some sensitive data */
fgets(secret, sizeof(secret), stdin);
|
...
Code Block | ||
---|---|---|
| ||
#include <sys/resource.h> /* ... */ struct rlimit limit; limit.rlim_cur = 0; limit.rlim_max = 0; if (setrlimit(RLIMIT_CORE, &limit) != 0) { /* Handle Error */ } if (mlock(secret, sizeof(secret)) != 0) { /* Handle error */ } /* Create or otherwise obtain some sensitive data */ fgets(secret, sizeof(secret), stdin); |
...
Code Block | ||
---|---|---|
| ||
if (VirtualLock(secret, sizeof(secret)) != 0) {
/* Handle error */
}
/* Create or otherwise obtain some sensitive data */
fgets(secret, sizeof(secret), stdin);
|
...
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MEM06-A | 1 ( low ) 1 ( | unlikely ) | 2 ( medium ) | P2 | L3 |
Related Vulnerabilities
...