Software Development Security
A team is rewriting a network-facing packet parser written in C that has repeated buffer overflow and use-after-free flaws. It must keep native speed and avoid garbage-collection pauses. Which language choice best removes these flaw classes?
Show the answer
Correct answerB. Rust
AWhy not this: Still an unsafe language; SAST finds some defects but does not eliminate the flaw classes.
BWhy this is right: Ownership and borrow checking give compile-time memory safety with native speed and no garbage collector.
CWhy not this: Memory safe, but it relies on a garbage collector, which the pause constraint rules out.
DWhy not this: Memory safe through the JVM, but it relies on garbage collection and a managed runtime.
Rust enforces memory safety at compile time through ownership and borrowing, so it removes overflow and use-after-free flaws without a garbage collector. Go and Java are memory safe but depend on garbage collection, which breaks the pause constraint.