diff options
| author | Warner Losh <imp@FreeBSD.org> | 1997-02-26 06:14:11 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1997-02-26 06:14:11 +0000 |
| commit | 910d59af8e141ca8c2435cb67eb94264d9f54d0e (patch) | |
| tree | 00c0204416515c7787c88ebba359a7f915ffed2b /lib/libc | |
| parent | 18a219a4b26de6b7d038c961f2b829f2c151c39f (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/net/rcmd.c | 3 |
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; |
