Live data from Hacker News

6 years and 360 patches to clean all instances of strnpy out of the Linux kernel

smist08.wordpress.com

41–42 of 42 posts

Re: 6 years and 360 patches to clean all instances of strnpy out of the Linux kernel

#42
post #35
post #19

Earlier quoted context omitted.

Should be using strcpy_s or strncpy_s.

Annex K (which is what that is) is sufficiently unpopular as to have been under discussion to be removed from the standard. Few implementations exist, and even fewer conform to the standard (e.g. Microsoft's doesn't). https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm Furthermore, since the kernel uses no C library, it's the kernel developer's choices what to implement and use.

Unpopular because it came from Microsoft. But it works, and with my safeclib even usable in the kernel.

The cited document is outdated. This is a better overview: https://rurban.github.io/safeclib/doc/safec-3.9/d6/d31/md_do...

Post reply on HN