Security Operations

A legacy C service copies user-supplied hostnames into a fixed 64-byte buffer. Crash dumps show overwritten return addresses, and the service cannot be rewritten in another language this quarter. Which change removes the root cause at the affected call sites?

Show the answer

Correct answerD. Swap unbounded copies for size-aware string functions

AWhy not this: Code signing proves who built the binary; it does nothing about a flaw in the code itself.

BWhy not this: A character allow list restricts content, not length, so a long string of permitted characters still overflows.

CWhy not this: Encryption protects data in transit; the service still copies the decrypted hostname into the small buffer.

DWhy this is right: Functions that take the destination size stop the copy at the buffer's end, so the overflow cannot happen.

Overwritten return addresses come from an unbounded copy overflowing a fixed buffer. Size-aware functions take the destination size and stop at it, removing the flaw without a rewrite. A character allow list does not limit length, so oversized input still overflows.