aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/lpd/printjob.c
diff options
context:
space:
mode:
authorGarance A Drosehn <gad@FreeBSD.org>2000-11-15 04:57:22 +0000
committerGarance A Drosehn <gad@FreeBSD.org>2000-11-15 04:57:22 +0000
commit59a09735efb4d9152bde289f3dd684da64ee897a (patch)
treea46bc944b85b0db28b72828c6bad8378b9e43235 /usr.sbin/lpr/lpd/printjob.c
parenta4f87098ce06dcdc5fe9f314e8a9776d8917c514 (diff)
Make sure a few strings will have terminating null characters.
(most of the PR 16186 was already applied, except for these 2 lines) PR: 16186 Submitted by: Przemyslaw Frasunek <venglin@lubi.FreeBSD.lublin.pl>
Notes
Notes: svn path=/head/; revision=68741
Diffstat (limited to 'usr.sbin/lpr/lpd/printjob.c')
-rw-r--r--usr.sbin/lpr/lpd/printjob.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index 03600f9440e2..740a1c54d441 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -890,6 +890,7 @@ sendit(pp, file)
}
} else if (line[0] == 'P') {
strncpy(logname, line+1, sizeof(logname) - 1);
+ logname[sizeof(logname) - 1] = '\0';
if (pp->restricted) { /* restricted */
if (getpwnam(logname) == NULL) {
sendmail(pp, line+1, NOACCT);
@@ -899,6 +900,7 @@ sendit(pp, file)
}
} else if (line[0] == 'I') {
strncpy(indent+2, line+1, sizeof(indent) - 3);
+ indent[2 + sizeof(indent) - 3] = '\0';
} else if (line[0] >= 'a' && line[0] <= 'z') {
strcpy(last, line);
while ((i = getline(cfp)) != 0)