Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 16th, 2018 80 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5.  
  6. extern char** environ;
  7.  
  8. void vuln(char *arg)
  9. {
  10.         char msg[12];
  11.         strcpy(msg,arg);
  12. }
  13.  
  14. int main(int argc, char** argv)
  15. {
  16.     int n=0;
  17.  
  18.         for (n = 0;  environ[n] != NULL;  ++n)
  19.     {
  20.         memset(environ[n], 0, strlen(environ[n]));
  21.         environ[n] = NULL;
  22.     }
  23.  
  24.  
  25.     if (argc != 2)
  26.     {
  27.         printf("Usage : prog arg\n");
  28.         exit(1);
  29.     }
  30.  
  31.     vuln(argv[1]);
  32.  
  33.  
  34.     return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top