[git commit] fdisk: placate warning of strncpy not copying NUL byte

Denys Vlasenko vda.linux at googlemail.com
Tue Jun 26 13:44:58 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=8ef9effaa558fbbf7e0f3b91a3faa4074686e671
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/fdisk_sgi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c
index 30def09c6..1cf0af5cc 100644
--- a/util-linux/fdisk_sgi.c
+++ b/util-linux/fdisk_sgi.c
@@ -425,7 +425,7 @@ create_sgiinfo(void)
 	/* I keep SGI's habit to write the sgilabel to the second block */
 	sgilabel->directory[0].vol_file_start = SGI_SSWAP32(2);
 	sgilabel->directory[0].vol_file_size = SGI_SSWAP32(sizeof(sgiinfo));
-	strncpy((char*)sgilabel->directory[0].vol_file_name, "sgilabel", 8);
+	memcpy((char*)sgilabel->directory[0].vol_file_name, "sgilabel", 8);
 }
 
 static sgiinfo *fill_sgiinfo(void);


More information about the busybox-cvs mailing list