Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/inetd Increase buffer size reported to strlcpy() to...



details:   https://anonhg.NetBSD.org/src/rev/90b835dad482
branches:  trunk
changeset: 821725:90b835dad482
user:      elric <elric%NetBSD.org@localhost>
date:      Wed Feb 15 02:48:31 2017 +0000

description:
Increase buffer size reported to strlcpy() to be one larger than the
length of the string we copy in so that there is space for the '\0'.

diffstat:

 usr.sbin/inetd/inetd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 401ed9ae98df -r 90b835dad482 usr.sbin/inetd/inetd.c
--- a/usr.sbin/inetd/inetd.c    Wed Feb 15 01:48:44 2017 +0000
+++ b/usr.sbin/inetd/inetd.c    Wed Feb 15 02:48:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $      */
+/*     $NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $        */
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = "@(#)inetd.c    8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $");
 #endif
 #endif /* not lint */
 
@@ -850,7 +850,7 @@
                        }
                        (void)unlink(sep->se_service);
                        strlcpy(sep->se_ctrladdr_un.sun_path,
-                           sep->se_service, n);
+                           sep->se_service, n + 1);
                        sep->se_ctrladdr_un.sun_family = AF_LOCAL;
                        sep->se_ctrladdr_size = (int)(n +
                            sizeof(sep->se_ctrladdr_un) -



Home | Main Index | Thread Index | Old Index