summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-17 06:52:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-17 06:52:20 +0000
commitdbb8d4ac2f03c53d3e4cb8eeb47d5b99efba5ccd (patch)
treef5bf413b9c211759d7648ae203520420924225c7 /usr.sbin/lpr
parent80bd8102a8430901b5ac8dfd4777d98373da5899 (diff)
Change a strcpy() -> strncpy() because I'm paranoid.
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index d720e946011..7766bb1763d 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recvjob.c,v 1.8 1997/07/16 22:31:26 deraadt Exp $ */
+/* $OpenBSD: recvjob.c,v 1.9 1997/07/17 06:52:19 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: recvjob.c,v 1.8 1997/07/16 22:31:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: recvjob.c,v 1.9 1997/07/17 06:52:19 millert Exp $";
#endif
#endif /* not lint */
@@ -178,7 +178,8 @@ readjob()
* something different than what gethostbyaddr()
* returns
*/
- strcpy(cp + 6, from);
+ strncpy(cp + 6, from, sizeof(line) + line - cp - 7);
+ line[sizeof(line) -1 ] = '\0';
strncpy(tfname, cp, sizeof tfname-1);
tfname[sizeof tfname-1] = '\0';
tfname[0] = 't';