summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-03-19 00:41:46 +0000
committerchristos <christos@NetBSD.org>2006-03-19 00:41:46 +0000
commitdf841f781507a7c3c31e10a236e635dd258335ff (patch)
treeb0fadcb244df4b579dbded22296aeb2a883c3660
parente9c5e5ae624072d97150a99f5caaa701145f6cd7 (diff)
downloadbsdgames-darwin-df841f781507a7c3c31e10a236e635dd258335ff.tar.gz
bsdgames-darwin-df841f781507a7c3c31e10a236e635dd258335ff.tar.zst
bsdgames-darwin-df841f781507a7c3c31e10a236e635dd258335ff.zip
Coverity CID 980: Prevent an impossible NULL point deref.
-rw-r--r--sail/dr_1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sail/dr_1.c b/sail/dr_1.c
index df2ade32..d9dbd8da 100644
--- a/sail/dr_1.c
+++ b/sail/dr_1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_1.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */
+/* $NetBSD: dr_1.c,v 1.22 2006/03/19 00:41:46 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_1.c,v 1.21 2004/11/05 21:30:32 dsl Exp $");
+__RCSID("$NetBSD: dr_1.c,v 1.22 2006/03/19 00:41:46 christos Exp $");
#endif
#endif /* not lint */
@@ -419,7 +419,7 @@ next(void)
bestship = s;
}
}
- if (best > 0.0) {
+ if (best > 0.0 && bestship) {
char *tp = getenv("WOTD");
const char *p;
if (tp == 0)