summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpd/printjob.c
diff options
context:
space:
mode:
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 03600f9..740a1c5 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)
OpenPOWER on IntegriCloud