Skip to content

A stack canary can help detect a buffer overflow if it is placed before the return address and checked before returning.

Answer

true

Explanation

### Why this is right The material describes placing a canary in front of the return address. If an overflow reaches and changes the return address, it should also overwrite the canary, which can be checked before the function returns. ### The concept A canary is a value used to detect certain memory overwrites. It does not prevent every memory error, but it can reveal that a stack overwrite occurred before the program uses the return address. ### The other options - **False**: incorrect because the material specifically describes this placement and check as a mitigation. ### Terms - **Stack canary**: a marker checked to detect certain stack overwrites. - **Return address**: a saved location used to continue program execution. ### Remember A canary is useful only if the program checks it before trusting affected control data.

Related Questions

Want to practice more questions like this?

Join myBenkio free and practice past questions for your Nigerian university courses with AI explanations for every answer.

Start Practicing Free