summaryrefslogtreecommitdiff
path: root/usr.bin/finger
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2014-10-17 20:16:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2014-10-17 20:16:14 +0000
commit7c4e118f27eb3f30572853fc159f78a3fa66b34d (patch)
tree9d7a135f9d1f97801a068f1e6429fe21aaed294e /usr.bin/finger
parentfd203e6f78619f4d6702a6f56356450ed4f5075f (diff)
Use strlcpy() instead of strncpy() when making a copy of pw_gecos.
Diffstat (limited to 'usr.bin/finger')
-rw-r--r--usr.bin/finger/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c
index de2053ee863..9cf730edde2 100644
--- a/usr.bin/finger/util.c
+++ b/usr.bin/finger/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.25 2014/10/17 08:03:04 doug Exp $ */
+/* $OpenBSD: util.c,v 1.26 2014/10/17 20:16:13 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -115,7 +115,7 @@ userinfo(PERSON *pn, struct passwd *pw)
pn->dir = estrdup(pw->pw_dir);
pn->shell = estrdup(pw->pw_shell);
- (void)strncpy(bp = tbuf, pw->pw_gecos, sizeof(tbuf));
+ (void)strlcpy(bp = tbuf, pw->pw_gecos, sizeof(tbuf));
/* ampersands get replaced by the login name */
if (!(p = strsep(&bp, ",")))
@@ -148,7 +148,7 @@ match(struct passwd *pw, char *user)
char *p, *t;
char name[1024];
- (void)strncpy(p = tbuf, pw->pw_gecos, sizeof(tbuf));
+ (void)strlcpy(p = tbuf, pw->pw_gecos, sizeof(tbuf));
/* ampersands get replaced by the login name */
if (!(p = strtok(p, ",")))