mirror of
https://github.com/The-Art-of-Hacking/h4cker.git
synced 2024-10-01 01:25:43 -04:00
14 lines
259 B
C
14 lines
259 B
C
|
#include <string.h>
|
||
|
void omarsucks(char *str)
|
||
|
{
|
||
|
char buffer[12];
|
||
|
/* The following strcpy will result in buffer overflow */
|
||
|
strcpy(buffer, str);
|
||
|
}
|
||
|
int main()
|
||
|
{
|
||
|
char *str = "This text is indeed a lot bigger or longer than 12";
|
||
|
omarsucks(str);
|
||
|
return 1;
|
||
|
}
|