I’m working on a school project, and basically we’re trying to learn about stack overflows. Some sample code that I’m working on is basically: (trimmed down)
char test[10];
int i;
for (i=0;i < 10000;i++) {
test[i] = 'a';
}
When I compile this with gcc, everything works all fine and dandy. Gcc automatically protects the stack and never lets it overflow outrageously. Now, if I try to use gcc -fno-stack-protector…. the exact same program runs. I even do a diff on the assembly files (the -S option) and they are identical. What gives? I searched through the man pages and there was no mention of the -fno-stack option… Everything online points to the -fno-stack-protector option, but I have not been able to recreate anything at all…
Thank you in advance for your help. 🙂
Are you sure? Mine gives (iff stack guard not disabled):
from