summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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