mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 16:31:18 +01:00
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:
parent
3006e31679
commit
a6150e80fe
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91740
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user