diff options
Diffstat (limited to 'usr.sbin/lpr/common_source/common.c')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 9b9244e..9f1ee41 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -307,7 +307,10 @@ checkremote() "unable to get official name for local machine %s", name); return errbuf; - } else (void) strcpy(name, hp->h_name); + } else { + (void) strncpy(name, hp->h_name, sizeof(name)); + name[sizeof(name) - 1] = '\0'; + } /* get the official name of RM */ hp = gethostbyname(RM); |