kconfig: nconf: Ensure null termination where strncpy is used
authorShankari Anand <shankari.ak0208@gmail.com>
Wed, 25 Jun 2025 19:06:54 +0000 (00:36 +0530)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 26 Jul 2025 06:31:17 +0000 (15:31 +0900)
commitf468992936894c9ce3b1659cf38c230d33b77a16
treec2f850cdbb7b5b3dd40e3f3389489bb5834f6036
parent9e0bd6db622c7c19aec5a8b248bb34493c9998e6
kconfig: nconf: Ensure null termination where strncpy is used

strncpy() does not guarantee null-termination if the source string is
longer than the destination buffer.

Ensure the buffer is explicitly null-terminated to prevent potential
string overflows or undefined behavior.

Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Nicolas Schier <n.schier@avm.de>
Acked-by: Nicolas Schier <n.schier@avm.de>
scripts/kconfig/nconf.c
scripts/kconfig/nconf.gui.c