summaryrefslogtreecommitdiffstats
path: root/atc
diff options
context:
space:
mode:
authorjnemeth <jnemeth@NetBSD.org>2006-06-07 09:24:26 +0000
committerjnemeth <jnemeth@NetBSD.org>2006-06-07 09:24:26 +0000
commit3d50fca30f7809fdcf80196ce456d6d005eb3af9 (patch)
tree94e4d3f1f54d12e22d6b9c066a9789b53205ae1b /atc
parentd983034d72c0dc19e69d18f64b56d6e92469dc80 (diff)
downloadbsdgames-darwin-3d50fca30f7809fdcf80196ce456d6d005eb3af9.tar.gz
bsdgames-darwin-3d50fca30f7809fdcf80196ce456d6d005eb3af9.tar.zst
bsdgames-darwin-3d50fca30f7809fdcf80196ce456d6d005eb3af9.zip
prevent "stack" overflow
Diffstat (limited to 'atc')
-rw-r--r--atc/include.h3
-rw-r--r--atc/input.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/atc/include.h b/atc/include.h
index 1697f6fb..11819951 100644
--- a/atc/include.h
+++ b/atc/include.h
@@ -1,4 +1,4 @@
-/* $NetBSD: include.h,v 1.8 2003/08/07 09:36:54 agc Exp $ */
+/* $NetBSD: include.h,v 1.9 2006/06/07 09:24:26 jnemeth Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,6 +50,7 @@
#include <sys/utsname.h>
#include <sys/wait.h>
+#include <assert.h>
#include <ctype.h>
#include <curses.h>
#include <err.h>
diff --git a/atc/input.c b/atc/input.c
index 64b202a1..2eef9053 100644
--- a/atc/input.c
+++ b/atc/input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: input.c,v 1.19 2005/08/10 17:53:28 rpaulo Exp $ */
+/* $NetBSD: input.c,v 1.20 2006/06/07 09:24:26 jnemeth Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: input.c,v 1.19 2005/08/10 17:53:28 rpaulo Exp $");
+__RCSID("$NetBSD: input.c,v 1.20 2006/06/07 09:24:26 jnemeth Exp $");
#endif
#endif /* not lint */
@@ -207,6 +207,7 @@ push(int ruleno, int ch)
{
int newstate, newpos;
+ assert(level < (MAXDEPTH - 1));
(void)sprintf(T_STR, st[T_STATE].rule[ruleno].str, tval);
T_RULE = ruleno;
T_CH = ch;