Re:Alpine Linux Security advisory: OpenSSH-server password a...
by ethin on Thursday November 05, 2026 @01:18PM
(#50382413)
Rust would not save you here as this is a logic bug. Nor would, well, really any other language. I suppose someone might claim that Rust's result type would save you but it really wouldn't: I can easily make the error type a String or pretty much any other type with little consequence.
[ Parent
| on HN ]
Re:Alpine Linux Security advisory: OpenSSH-server password a...
by iknowstuff on Thursday November 05, 2026 @01:24PM
(#50382519)
It would, due to Result<T> and #[must_use] on it. Nobody would return “*” as a sentinel in Rust.
Re:Alpine Linux Security advisory: OpenSSH-server password a...
by K0nserv on Thursday November 05, 2026 @01:30PM
(#50382610)
Rust would absolutely have saved you here. Even with `Result<String, String>`, which is pretty poor design, there's no confusing `Ok(s)` with `Err(s)`. Sure you can go out of your way to write something like
let hash = match result {
OK(s) => s,
Err(s) => s,
};
but at that point I feel like the library is forgiven (except for the poor error design).@my-huge-pony does make a good point elsewhere in the thread: if the potential error was not foreseen and the code was written originally to return `String` instead of `Result<String, Error>` then even Rust would be in a pickle.
Re:Alpine Linux Security advisory: OpenSSH-server password a...
by slopinthebag on Thursday November 05, 2026 @03:47PM
(#50384276)
languages with more features would mean developers aren't choosing between unchecked NULLs or sentinel strings.