Boundary check an array holding tab stops.

PR:		bin/35590
Submitted by:	"Tim J. Robbins" <tim@robbins.dropbear.id.au>
This commit is contained in:
Ruslan Ermilov 2002-03-06 12:05:17 +00:00
parent 3006e31679
commit a6150e80fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91740

View File

@ -162,6 +162,8 @@ getstops(cp)
errx(1, "bad tab stop spec");
if (nstops > 0 && i <= tabstops[nstops-1])
errx(1, "bad tab stop spec");
if (nstops == sizeof(tabstops) / sizeof(*tabstops))
errx(1, "too many tab stops");
tabstops[nstops++] = i;
if (*cp == 0)
break;