*sshole, or when are we going to get rid of C?

19 hours ago (sunshowers.io)

This is less a problem with C and more a bad design decision by the musl team. In response to poor practices (programmers not checking what crypt returned), they built an arguably worse one (returning a sentinel value).

Sure, Rust's std::result can make it harder to dumb, but dumb can always find a way.

  • From the post:

    > You can very well write a Rust function that returns "*" if the password is too long. But the big difference between C and Rust in this regard is that the norms of the Rust community do not allow that.

Except *sshole isn't a memory safety vulnerability - it's a logic bug. And logic bugs happen in every programming language.

  • Yes, this is explicitly discussed in the post:

    > This is not a memory safety vulnerability; rather, it is one of those issues that, people often say, languages with better type systems won’t save you from. This is true! You can very well write a Rust function that returns "" if the password is too long. But the big difference between C and Rust in this regard is that the norms of the Rust community do not allow that.*

What does it have to do with C? It's just poor design.

It's like blaming poor driving on one's tracksuit.

  • If safety features are available and you choose not to use them then that's bad engineering.

    I love K&R as much as the next guy but special magic ASCII chars multiply defined by convention over 40 years is exactly the sort of rubbish a good type system can protect against (if used).

  • I could see the same thing in Python. Except instead it would be an inhandled none they didn’t like so they would return a *.

Oohhh there’s one more C vulnerability. Oh my gosh, what ever will I do? Should I buy a new smart toaster? I’m not sure. I just really don’t know what to do right now.

It’s called pay attention and f*king upgrade your packages.