Created
August 4, 2014 17:36
-
-
Save Inndy/9bad01f987a8e0c16221 to your computer and use it in GitHub Desktop.
DONT COPY THIS! VULNERABLE CODE!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DONT COPY THIS! VULNERABLE CODE! */ | |
#include <stdio.h> | |
void read_the_file (FILE *fp) { | |
char buffer[8]; | |
fgets(buffer, 72, fp); // 72bytes WTF? | |
} | |
int main (int argc, const char *argv[]) { | |
if (argc < 2) { | |
printf("Usage: %s input.dat\n", argv[0]); | |
return 1; | |
} | |
FILE *fp = fopen(argv[1], "rb"); | |
read_the_file(fp); | |
fclose(fp); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment