kconfig: lxdialog: replace strcpy with snprintf in print_autowrap
authorSuchit Karunakaran <suchitkarunakaran@gmail.com>
Sat, 26 Jul 2025 19:43:07 +0000 (01:13 +0530)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 6 Aug 2025 01:23:36 +0000 (10:23 +0900)
commit1918f983687aa73bf0e5bc73431898994fce35a8
treec290d1415f777392f71c23d4fbcfae032956fc9c
parenteb549e194bf2d5c86b1b7a71fad54d610dd6c892
kconfig: lxdialog: replace strcpy with snprintf in print_autowrap

strcpy() does not perform bounds checking and can lead to buffer overflows
if the source string exceeds the destination buffer size. In
print_autowrap(), replace strcpy() with snprintf() to safely copy the
prompt string into the fixed-size tempstr buffer.

Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/lxdialog/util.c