summaryrefslogtreecommitdiff
path: root/lib/libc/net/rcmd.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1997-02-26 06:12:34 +0000
committerWarner Losh <imp@FreeBSD.org>1997-02-26 06:12:34 +0000
commit2a62f0231541fb03a3be15684815209d56c7f686 (patch)
tree985495b1a1b5257d826cfbf5d70b5ab0047e479c /lib/libc/net/rcmd.c
parent326bb3d177857385f5a63ed5f770b6d69f34c751 (diff)
Notes
Diffstat (limited to 'lib/libc/net/rcmd.c')
-rw-r--r--lib/libc/net/rcmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 0aa99c37d970..ff108d9d03d4 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -393,7 +393,8 @@ __ivaliduser(hostf, raddr, luser, ruser)
if ((hp = gethostbyaddr((char *)&raddr, sizeof(u_long),
AF_INET)) == NULL)
return (-1);
- strcpy(hname, hp->h_name);
+ strncpy(hname, hp->h_name, sizeof(hname));
+ hname[sizeof(hname) - 1] = '\0';
while (fgets(buf, sizeof(buf), hostf)) {
p = buf;