Last active
September 28, 2021 18:06
-
-
Save say4n/a5122b6b8afef54f9cd2c66bcf856779 to your computer and use it in GitHub Desktop.
Buffer Overflow
This file contains 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
#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