lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250317152257605EN-VIC5_IyrowJu481BsZ@zte.com.cn>
Date: Mon, 17 Mar 2025 15:22:57 +0800 (CST)
From: <feng.wei8@....com.cn>
To: <linux-kernel@...r.kernel.org>
Cc: <masahiroy@...nel.org>, <linux-kbuild@...r.kernel.org>
Subject: [PATCH] kconfig: Replace strncpy() with strscpy()

From: FengWei <feng.wei8@....com.cn>

supplemented:
strncpy() is deprecated for NUL-terminated destination buffers. Use
strscpy() instead and remove the manual NUL-termination.

Signed-off-by: FengWei <feng.wei8@....com.cn>
---
 scripts/kconfig/confdata.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index ac95661a1c9d..e547ce003f00 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -970,8 +970,7 @@ static int conf_touch_deps(void)
 	if (depfile_prefix_len + 1 > sizeof(depfile_path))
 		return -1;

-	strncpy(depfile_path, name, depfile_prefix_len);
-	depfile_path[depfile_prefix_len] = 0;
+	strscpy(depfile_path, name, depfile_prefix_len);

 	conf_read_simple(name, S_DEF_AUTO);

-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ