Linux Kills Strncpy
Summary
Stephen Smith’s blog post argues that strncpy is a source of security issues in C, particularly within the Linux kernel, and describes how the kernel moved away from strncpy to safer alternatives. It explains the historical problems with strcpy/strncpy, the six-year, 360-patch effort to remove strnpy, and introduces safer functions like strscpy and strscpy_pad, along with guidance on when to use each helper to maintain termination, avoid padding pitfalls, and improve correctness.