summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/xlint/lint2/read.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/xlint/lint2/read.c b/usr.bin/xlint/lint2/read.c
index 615c6a971c8..b9d518d53ef 100644
--- a/usr.bin/xlint/lint2/read.c
+++ b/usr.bin/xlint/lint2/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.10 2010/07/24 22:17:03 guenther Exp $ */
+/* $OpenBSD: read.c,v 1.11 2011/03/15 21:59:27 espie Exp $ */
/* $NetBSD: read.c,v 1.2 1995/07/03 21:24:59 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: read.c,v 1.10 2010/07/24 22:17:03 guenther Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.11 2011/03/15 21:59:27 espie Exp $";
#endif
#include <stdio.h>
@@ -161,6 +161,8 @@ readfile(const char *name)
if (cp == eptr)
inperr();
cp = eptr;
+ if (isrc < 0 || isrc >= ninpfns)
+ inperr();
isrc = inpfns[isrc];
/* line number in isrc */