
Linux kernel 7.2 completes memory-safety overhaul by retiring unsafe strncpy() function
Linux 7.2 has removed all remaining strncpy() calls, finishing a multi-year cleanup. The function risked silent buffer overflows by failing to guarantee null termination when strings exceeded buffer capacity. Developers replaced it with strscpy(), which always terminates correctly and flags truncation with -E2BIG error codes. Independent vendors must conduct their own replacements.
Published