MFOpenBSD rev 1.9: fix a buffer overflow when processing config file

lines that are exactly 81 characters in length.

Obtained from:	OpenBSD
MFC After:	3 days
This commit is contained in:
Brooks Davis 2005-08-24 00:05:04 +00:00
parent 8794fdbb48
commit 1469b42c7d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149400

View File

@ -104,7 +104,7 @@ get_char(FILE *cfile)
lpos = 1;
cur_line[0] = 0;
} else if (c != EOF) {
if (lpos <= 81) {
if (lpos < sizeof(line1)) {
cur_line[lpos - 1] = c;
cur_line[lpos] = 0;
}