Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Rever previous: the d_packname in struct di...



details:   https://anonhg.NetBSD.org/src/rev/4bfd9c70f09f
branches:  trunk
changeset: 744968:4bfd9c70f09f
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 19 21:45:09 2020 +0000

description:
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.

diffstat:

 usr.sbin/sysinst/Makefile.inc |  3 ++-
 usr.sbin/sysinst/disklabel.c  |  4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r ade9437b8019 -r 4bfd9c70f09f usr.sbin/sysinst/Makefile.inc
--- a/usr.sbin/sysinst/Makefile.inc     Wed Feb 19 21:42:53 2020 +0000
+++ b/usr.sbin/sysinst/Makefile.inc     Wed Feb 19 21:45:09 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.32 2020/02/19 21:42:53 martin Exp $
+#      $NetBSD: Makefile.inc,v 1.33 2020/02/19 21:45:09 martin Exp $
 #
 # Makefile for sysinst
 
@@ -128,6 +128,7 @@
 .endif
 
 COPTS+=        ${GCC_NO_FORMAT_TRUNCATION}
+COPTS.disklabel.c+= ${GCC_NO_STRINGOP_TRUNCATION}
 
 # Host to ftp from.  Default:
 #      "ftp.NetBSD.org"
diff -r ade9437b8019 -r 4bfd9c70f09f usr.sbin/sysinst/disklabel.c
--- a/usr.sbin/sysinst/disklabel.c      Wed Feb 19 21:42:53 2020 +0000
+++ b/usr.sbin/sysinst/disklabel.c      Wed Feb 19 21:45:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.36 2020/02/19 18:08:03 martin Exp $    */
+/*     $NetBSD: disklabel.c,v 1.37 2020/02/19 21:45:09 martin Exp $    */
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -934,7 +934,7 @@
        struct disklabel_disk_partitions *parts =
            (struct disklabel_disk_partitions*)arg;
 
-       strlcpy(parts->l.d_packname, pack, sizeof(parts->l.d_packname));
+       strncpy(parts->l.d_packname, pack, sizeof(parts->l.d_packname));
        return true;
 }
 



Home | Main Index | Thread Index | Old Index