Skip to content

Instantly share code, notes, and snippets.

@saibikalpa
Created January 8, 2019 06:34
Show Gist options
  • Save saibikalpa/92419c65c472469ba73f8559ceca0454 to your computer and use it in GitHub Desktop.
Save saibikalpa/92419c65c472469ba73f8559ceca0454 to your computer and use it in GitHub Desktop.
Sample C program vulnerable to buffer overflow
#include <stdio.h>
#include <unistd.h>
int foo(){
char buffer[600];
int characters_read;
printf("Enter some string:\n");
characters_read = read(0, buffer, 1000);
printf("You entered: %s", buffer);
return 0;
}
void main(){
foo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment