summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2000-11-15 04:57:22 +0000
committergad <gad@FreeBSD.org>2000-11-15 04:57:22 +0000
commit2885965ea9e40fc50d4202714c6ca1a969df743a (patch)
treed638ce8eef72cd1abf2580c2e1b2ccbd819fa15d
parent69af93ca7cbfc6ff4b3cbe981063c469e2e7f03b (diff)
downloadFreeBSD-src-2885965ea9e40fc50d4202714c6ca1a969df743a.zip
FreeBSD-src-2885965ea9e40fc50d4202714c6ca1a969df743a.tar.gz
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>
-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