From d425ea7991773e7a64d9d22b91d2d245c6a717e7 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 18 Mar 2006 23:54:17 +0000 Subject: Coverity CID 827: Prevent NULL pointer deref. --- fortune/fortune/fortune.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c index 7c7c48e0..2addaab8 100644 --- a/fortune/fortune/fortune.c +++ b/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.46 2006/03/18 23:51:51 christos Exp $ */ +/* $NetBSD: fortune.c,v 1.47 2006/03/18 23:54:17 christos Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.46 2006/03/18 23:51:51 christos Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.47 2006/03/18 23:54:17 christos Exp $"); #endif #endif /* not lint */ @@ -614,7 +614,7 @@ over: * we are scanning a directory, since the scan will pick up the * -o file anyway. */ - if (All_forts && parent == NULL && !is_off_name(path)) + if (All_forts && parent == NULL && !is_off_name(path) && offensive) all_forts(fp, offensive); if (*head == NULL) *head = *tail = fp; -- cgit v1.2.3