Files
Thorsten Blum ff736a2861 net: ipconfig: Replace strncpy with strscpy in ic_proto_name
strncpy() is deprecated [1] for NUL-terminated destination buffers
because it does not guarantee NUL termination. Replace it with strscpy()
to ensure the destination buffer is always NUL-terminated and to avoid
any additional NUL padding.

Although the identifier buffer has 252 usable bytes, strncpy() copied
only up to 251 bytes to the zero-initialized buffer, relying on the last
byte to act as an implicit NUL terminator. Switching to strscpy() avoids
this implicit behavior and does not use magic numbers.

The source string is also NUL-terminated and satisfies the
__must_be_cstr() requirement of strscpy().

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20251126220804.102160-2-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-28 20:19:16 -08:00
..
2025-11-24 19:49:40 -08:00
2025-03-17 13:56:38 +00:00
2025-10-29 18:28:29 -07:00
2025-08-29 19:36:32 -07:00
2025-08-26 17:34:31 -07:00
2025-07-08 13:28:27 +02:00
2025-08-29 19:36:32 -07:00
2024-01-04 10:23:10 -08:00
2025-09-18 08:47:51 +02:00
2025-03-17 13:54:11 +00:00
2025-03-17 13:56:38 +00:00
2022-12-20 03:13:45 +01:00