summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpc.lockd/procs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/rpc.lockd/procs.c b/usr.sbin/rpc.lockd/procs.c
index 54e5f814ceb..91a2a220cfe 100644
--- a/usr.sbin/rpc.lockd/procs.c
+++ b/usr.sbin/rpc.lockd/procs.c
@@ -64,7 +64,7 @@ static void log_from_addr(char *fun_name, struct svc_req *req)
host = gethostbyaddr((char *)&(addr->sin_addr), addr->sin_len, AF_INET);
if (host)
{
- strncpy(hostname_buf, host->h_name, sizeof(hostname_buf));
+ strncpy(hostname_buf, host->h_name, sizeof(hostname_buf) -1);
hostname_buf[sizeof(hostname_buf) -1] = '\0';
}
else /* No hostname available - print raw address */