Module Name:    src
Committed By:   martin
Date:           Sat Jul 17 19:27:23 UTC 2021

Modified Files:
        src/usr.sbin/sysinst: gpt.c

Log Message:
Use strlcpy() to copy the wedge device name (the code still assumes
the string is short enough and 0 terminated, but now gcc is happy).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/gpt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.25 src/usr.sbin/sysinst/gpt.c:1.26
--- src/usr.sbin/sysinst/gpt.c:1.25	Sat Jul 17 18:07:22 2021
+++ src/usr.sbin/sysinst/gpt.c	Sat Jul 17 19:27:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.25 2021/07/17 18:07:22 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.26 2021/07/17 19:27:22 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -1380,7 +1380,7 @@ gpt_sanitize(int diskfd, const struct gp
 		if (found)
 			continue;
 		memset(&delw, 0, sizeof(delw));
-		strncpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname));
+		strlcpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname));
 		(void)ioctl(diskfd, DIOCDWEDGE, &delw);
 	}
 

Reply via email to