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>
This commit is contained in:
Garance A Drosehn 2000-11-15 04:57:22 +00:00
parent a4f87098ce
commit 59a09735ef
1 changed files with 2 additions and 0 deletions

View File

@ -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)