Zap another buffer overflow, this time in the parser.

MFC after:	2 weeks
This commit is contained in:
Tim J. Robbins 2002-11-01 12:09:05 +00:00
parent c26c35e7d9
commit 92d2efaaca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106294

View File

@ -191,6 +191,8 @@ copystr(void)
char *cp = buf;
for (;;) {
if (cp == buf + sizeof(buf) - 2)
errx(1, "message too long");
c = getchar();
if (c == EOF)
break;