Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/altq/altqstat usr.sbin/altq: Revert the strlcpy(3) ...



details:   https://anonhg.NetBSD.org/src/rev/231079246845
branches:  trunk
changeset: 744604:231079246845
user:      fox <fox%NetBSD.org@localhost>
date:      Fri Feb 07 21:53:20 2020 +0000

description:
usr.sbin/altq: Revert the strlcpy(3) change since this changes expected behavior from strncpy(3).

Reviewed by: kamil@

diffstat:

 usr.sbin/altq/altqstat/quip_client.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 3a952cd63985 -r 231079246845 usr.sbin/altq/altqstat/quip_client.c
--- a/usr.sbin/altq/altqstat/quip_client.c      Fri Feb 07 20:34:18 2020 +0000
+++ b/usr.sbin/altq/altqstat/quip_client.c      Fri Feb 07 21:53:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: quip_client.c,v 1.13 2020/02/07 20:13:26 fox Exp $     */
+/*     $NetBSD: quip_client.c,v 1.14 2020/02/07 21:53:20 fox Exp $     */
 /*     $KAME: quip_client.c,v 1.9 2003/05/17 05:59:00 itojun Exp $     */
 /*
  * Copyright (C) 1999-2000
@@ -454,7 +454,8 @@
        else
                len = strlen(name);
        len = MIN(len, 63);
-       strlcpy(ifname, name, len);
+       strncpy(ifname, name, len);
+       ifname[len] = '\0';
        return (ifname);
 }
 



Home | Main Index | Thread Index | Old Index