mirror of
https://github.com/The-Art-of-Hacking/h4cker.git
synced 2025-08-11 07:40:20 -04:00
adding buffer overflow example
This commit is contained in:
parent
0ae3754d31
commit
7f9b4eb866
2 changed files with 54 additions and 0 deletions
23
buffer_overflow_example/bad_code.c
Normal file
23
buffer_overflow_example/bad_code.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <stdio.h>
|
||||
|
||||
void secretFunction()
|
||||
{
|
||||
printf("Omar's Crappy Function\n");
|
||||
printf("This is a super secret function!\n");
|
||||
}
|
||||
|
||||
void echo()
|
||||
{
|
||||
char buffer[20];
|
||||
|
||||
printf("Please enter your name below:\n");
|
||||
scanf("%s", buffer);
|
||||
printf("You entered: %s\n", buffer);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
echo();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue