]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:02 +0000 (16:26 +0200)
commitcd22e2f93157ac12ca3f26285775d38d8b1ace62
tree73b9ddcd57a64f65c3b23304953cac8a649ad8ad
parenteeba1284f3c195872ba6d948feebee9e64ca044b
kconfig: nconf: Ensure null termination where strncpy is used

[ Upstream commit f468992936894c9ce3b1659cf38c230d33b77a16 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/kconfig/nconf.c
scripts/kconfig/nconf.gui.c