summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2011-03-15 21:59:28 +0000
committerMarc Espie <espie@cvs.openbsd.org>2011-03-15 21:59:28 +0000
commit9c5e7980c27933fd93cf4fdae7ee9722775c052c (patch)
tree0a56f17bdfda283829f5d579022e741ce5a45ecb /usr.bin
parent3aadf75fa2a0268eb92fce58c894d497704be093 (diff)
sanity check, prompted by common work with Florent Tribouilloy
ok deraadt@, millert@
Diffstat (limited to 'usr.bin')
-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 */