Fun to see the Linux kernel follow in #curl's footsteps!
-
RE: https://hachyderm.io/@kees/116282745861595200
Fun to see the Linux kernel follow in #curl's footsteps!
(we removed the last strncpy from curl in late 2025) -
RE: https://hachyderm.io/@kees/116282745861595200
Fun to see the Linux kernel follow in #curl's footsteps!
(we removed the last strncpy from curl in late 2025)@bagder Long time ago, there was small project called qmail in C, author started project by rethinging/replacing almost every standard C function.
-
RE: https://hachyderm.io/@kees/116282745861595200
Fun to see the Linux kernel follow in #curl's footsteps!
(we removed the last strncpy from curl in late 2025)@bagder so some time around 2040 we'll have 99% of things using a kernel without it.
My snark comes from two months of broken audio stack on my android phone that was a unterminated string issue.
-
R relay@relay.an.exchange shared this topic
-
RE: https://hachyderm.io/@kees/116282745861595200
Fun to see the Linux kernel follow in #curl's footsteps!
(we removed the last strncpy from curl in late 2025)Do I understand correctly that the problem with strncpy is that after the call you don't know if the buffer is NUL terminated or not?
-
Do I understand correctly that the problem with strncpy is that after the call you don't know if the buffer is NUL terminated or not?
@kasperd yes. but we also find that code generally improves using other solutions so in curl we don't replace it with something that guarantees a null terminator. We write the code another way instead.
-
R relay@relay.infosec.exchange shared this topic