Source-Changes-HG archive

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

[src/trunk]: src/lib/libisns use strlcpy (the buffer is already zeroed)



details:   https://anonhg.NetBSD.org/src/rev/292bb4ec96a4
branches:  trunk
changeset: 460119:292bb4ec96a4
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Oct 08 19:38:27 2019 +0000

description:
use strlcpy (the buffer is already zeroed)

diffstat:

 lib/libisns/isns.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r d0b95fc73795 -r 292bb4ec96a4 lib/libisns/isns.c
--- a/lib/libisns/isns.c        Tue Oct 08 19:21:40 2019 +0000
+++ b/lib/libisns/isns.c        Tue Oct 08 19:38:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isns.c,v 1.1.1.1 2011/01/16 01:22:50 agc Exp $ */
+/*     $NetBSD: isns.c,v 1.2 2019/10/08 19:38:27 christos Exp $        */
 
 /*-
  * Copyright (c) 2004,2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: isns.c,v 1.1.1.1 2011/01/16 01:22:50 agc Exp $");
+__RCSID("$NetBSD: isns.c,v 1.2 2019/10/08 19:38:27 christos Exp $");
 
 /*
  * isns.c
@@ -153,7 +153,7 @@
                        return ENOMEM;
                }
                memset(ai_p->ai_canonname, '\0', len + 1);
-               strncpy(ai_p->ai_canonname, ai->ai_canonname, len);
+               strlcpy(ai_p->ai_canonname, ai->ai_canonname, len + 1);
        } else
                ai_p->ai_canonname = NULL;
        if (ai->ai_addr != NULL) { 



Home | Main Index | Thread Index | Old Index