Do -fstack-protector and -fstack-protector-all protect heap-based memory allocations too or only stack-based ones ?
What is the difference between the first 2 and -fmudflap ?
Any recommendations as to which is better for debugging ?
(I'm not sure if the gcc man page is clear enough or I simply do not understand it...)
char foobar[10]; // stack-based
char *foobar = malloc(10); // heap-based
-fstack-protector and -fstack-protector-all have nothing to do with heap allocations.
-fstack-protector protects strings only (main problem target for buffer overflow attacks), -fstack-protector-all protects all types. Some descriptions here:
http://en.wikipedia.org/wiki/Buffer_overflow_protection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With