Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Memory dumps are automatically created when your program crashes. These memory dumps can contain information stored in any part of program memory. It is advised to disable memory dumps in the program that is being shipped to the user. This might not be possible on Windows, but on linux, this can be done as follows1#1:

Code Block
bgColor#ccccff
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

int main(int argc, char **argv){

  struct rlimit rlim;

  getrlimit(RLIMIT_CORE, &rlim);
  rlim.rlim_max = rlim.rlim_cur = 0;

  if(setrlimit(RLIMIT_CORE, &rlim)) {
    // unable to secure data.
    exit(-1);

  }
  ...

...

Wiki Markup
\[[MSDN|AA. C References#MSDN]\] [{{EncodePointer()}}|http://msdn.microsoft.com/en-us/library/bb432254(VS.85).aspx], [{{DecodePointer()}}|http://msdn.microsoft.com/en-us/library/bb432242(VS.85).aspx]
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="be2d76d8-48db-454b-b071-92bb63450bac"><ac:parameter ac:name="">1</ac:parameter></ac:structured-macro> John Viega, [Protecting sensitive data in memory| http://www.cgisecurity.com/lib/protecting-sensitive-data.html], Feb 2001