Multiple choice technology security

Which compilation switch should be enabled for stack protection? Choose the best and most secure option.

  1. fstack-protector

  2. fstack-protector-all

  3. fdelete-null-pointer-checks

  4. Both a and b

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

-fstack-protector-all is the most secure option because it enables stack protection for all functions, regardless of their local variables. -fstack-protector only protects functions with vulnerable buffers (like char arrays of size 8 or larger).