summaryrefslogtreecommitdiffstats
path: root/usr.bin/expand
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-03-06 12:05:17 +0000
committerru <ru@FreeBSD.org>2002-03-06 12:05:17 +0000
commit5e2e7f621a93a4d50c628dcf6afa5e47143447d3 (patch)
treede9406f30f28c352db9b2f2323abbeeb0781ed24 /usr.bin/expand
parent11add29df067838e23b834a3dcb853dfa4064983 (diff)
downloadFreeBSD-src-5e2e7f621a93a4d50c628dcf6afa5e47143447d3.zip
FreeBSD-src-5e2e7f621a93a4d50c628dcf6afa5e47143447d3.tar.gz
Boundary check an array holding tab stops.
PR: bin/35590 Submitted by: "Tim J. Robbins" <tim@robbins.dropbear.id.au>
Diffstat (limited to 'usr.bin/expand')
-rw-r--r--usr.bin/expand/expand.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index 06f1362..5ecd764 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -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;
OpenPOWER on IntegriCloud