1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <stdio.h> #include <stdlib.h> #include <string.h> void stupid(char *str) { char buf[30]; /* exploitable function */ strcpy(buf, str); } int main(int argc, char **argv) { stupid(argv[1]); return 0; }