I'm trying to smash the stack and am using the below C code:
#include<stdio.h>
get_inp()
{
char buf[8];
gets(buf);
puts(buf);
}
main(){
get_inp();
return 0;
}
I get the Segmentation fault only if I enter a minimum of 16 characters as input. Running this on an IA-32 architecture. Since the EBP occupies 4 bytes after the allocated buffer shouldn't I be getting the seg fault after inputting 12 characters. Would appreciate some clarity on this.