Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider (sch jbop) (X_X)@==(Q_Q)@

...

Code Block
bgColor#ccccff
#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
bgColor#CCCCFF
#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
bgColor#CCCCFF
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

...