From 61aa720c34b550ed8fd6f2144d7f262ddd54c979 Mon Sep 17 00:00:00 2001 From: bitblt Date: Sun, 15 Dec 1996 05:57:20 +0000 Subject: [PATCH] FIxed an ofF-by-one error. --- usr.sbin/sliplogin/sliplogin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/sliplogin/sliplogin.c b/usr.sbin/sliplogin/sliplogin.c index d7bd0c7782f..0fcc2b5109c 100644 --- a/usr.sbin/sliplogin/sliplogin.c +++ b/usr.sbin/sliplogin/sliplogin.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)sliplogin.c 5.6 (Berkeley) 3/2/91";*/ -static char rcsid[] = "$Id: sliplogin.c,v 1.5 1996/08/08 15:38:52 millert Exp $"; +static char rcsid[] = "$Id: sliplogin.c,v 1.6 1996/12/15 05:57:20 bitblt Exp $"; #endif /* not lint */ /* @@ -121,7 +121,8 @@ findid(name) char user[16], *p; int i, j, n; - (void)strncpy(loginname, name, sizeof loginname); + (void)strncpy(loginname, name, sizeof loginname-1); + loginname[sizeof loginname -1] = '\0'; if ((fp = fopen(_PATH_ACCESS, "r")) == NULL) { syslog(LOG_ERR, "%s: %m\n", _PATH_ACCESS); err(1, "%s", _PATH_ACCESS); -- 2.20.1