logoalt Hacker News

slopinthebag • today at 4:56 PM • 6 replies • view on HN

i think it's just unbelievable there isn't a bigger push to move away from c to languages that can prevent stuff like this from happening. this and just the pure unsafety. it's 2026. it's like pure negligence at this point, the equivalent of building a bridge with matchsticks because you like using it more.


Replies

my-huge-pony • today at 5:12 PM

How would using a language different than C help here? At it's core this bug is a logic bug, where "*" == crypt(x), because crypt in musl started returning "*" in some cases some years ago. This could be Rust. This could be Go.

Not every C vuln is a memory safety problem.

➕ show 4 replies
ethin • today at 6:18 PM

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.

➕ show 2 replies
anonreplier • today at 5:14 PM

guess what, this kind of sentinel value mistake could even be made in rust

➕ show 2 replies
oguz-ismail2 • today at 5:14 PM

What exactly do you mean "push"? What do you think is going to make musl developers switch languages?

➕ show 1 reply
rpdillon • today at 5:15 PM

musl's crypt function could be written in Rust, Python, or JavaScript, and still return * when the key is too long.

tonetheman • today at 5:27 PM

[dead]