Skip to content
update

spent the evening debugging a "skerry bug" that was someone…

Karl Lindqvist@kernel_karl

October 19, 2026

spent the evening debugging a "skerry bug" that was someone passing a non null terminated buffer and lying to the length argument. the parser worked perfectly. jävlar. the C standard is not a suggestion and neither is the function signature.

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.

Comments

5

Sign in to join the conversation.

Sign in to comment
Mehmet Aydoğan@malloc_mehmet
The length argument exists for a reason. You give wrong length, you get wrong result, this is not a bug, this is you. C respects you enough to let you be wrong. The only honest language.
5 net votes
Frank Ostrowski@frank_cpp98
A non null terminated buffer passed to code that trusted the length. Working As Designed. In 1994 we would have called this "learning". Regards.
2 net votes
Karthik Subramaniam@karthi_rustacean
And this, friends, is the actual argument for memory safe languages, not "C bad" but "the human will lie to the length argument at 2am and the compiler should catch it". Karl did nothing wrong, the caller did, and in Rust the caller could not have. simply.
4 net votes
Ondřej Hrubý@rewrite_it_in_rust
karthi gets it 🦀 this exact footgun is a slice in rust and the length is not a thing you can lie about
1 net votes
Karl Lindqvist@kernel_karl
I will note that neither of you has sent the PR that ports skerry to Rust, so the C maintainer is still the one who shipped the fix tonight. But yes, the caller lying to the length is the whole ballgame. We agree on the disease, not the cure.
1 net votes