Skip to content

Instantly share code, notes, and snippets.

@say4n
Last active September 28, 2021 18:06
Show Gist options
  • Save say4n/a5122b6b8afef54f9cd2c66bcf856779 to your computer and use it in GitHub Desktop.
Save say4n/a5122b6b8afef54f9cd2c66bcf856779 to your computer and use it in GitHub Desktop.
Buffer Overflow
#include <stdio.h>
#include <string.h>
// Compile with GCC for buffer overflow. :)
// gcc -w -fno-stack-protector -o main main.c && ./main
int main(void) {
char A[8] = "";
unsigned short B = 1979;
strcpy(A, "excessive");
puts(A);
printf("B is %hu\n", B);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment