summaryrefslogtreecommitdiff
path: root/games/battlestar
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>2003-05-19 08:49:10 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>2003-05-19 08:49:10 +0000
commitbd60586a3f19e67fffe67b1c3335f2e105eaa358 (patch)
tree8e8755906d7070a4b5ab533ddcbbeb4ad365a13a /games/battlestar
parent0d7e276c309e81b8d7d940dc89c712605492904e (diff)
NetBSD check to make sure not to deref -1.
Diffstat (limited to 'games/battlestar')
-rw-r--r--games/battlestar/com2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/games/battlestar/com2.c b/games/battlestar/com2.c
index 974157a06ed..9f28893a3e5 100644
--- a/games/battlestar/com2.c
+++ b/games/battlestar/com2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com2.c,v 1.12 2000/09/26 04:42:55 pjanzen Exp $ */
+/* $OpenBSD: com2.c,v 1.13 2003/05/19 08:49:09 pjanzen Exp $ */
/* $NetBSD: com2.c,v 1.3 1995/03/21 15:06:55 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: com2.c,v 1.12 2000/09/26 04:42:55 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: com2.c,v 1.13 2003/05/19 08:49:09 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -54,7 +54,7 @@ wearit()
while (wordnumber <= wordcount && (wordtype[wordnumber] == OBJECT ||
(wordtype[wordnumber] == NOUNS && wordvalue[wordnumber] != DOOR))) {
value = wordvalue[wordnumber];
- if (objsht[value] == NULL)
+ if (value >= 0 && objsht[value] == NULL)
break;
switch (value) {