Skip to content

Instantly share code, notes, and snippets.

@DiegoCaridei
Last active September 29, 2019 09:57
Show Gist options
  • Save DiegoCaridei/6e8fb862b4c75255fa00222714e13719 to your computer and use it in GitHub Desktop.
Save DiegoCaridei/6e8fb862b4c75255fa00222714e13719 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <unistd.h>
int overflow () {
char buffer [500];
int userinput;
userinput =read(0, buffer,700);
printf("\nUser provided %d bytes. Buffer content is %s\n", userinput, buffer);
return 0;
}
int main(int argc, const char * argv[]) {
overflow ();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment