From 0a1c2ab0b80bd016b5a1f207eb8e81a7ef23dbd7 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 13 Apr 2006 18:59:58 +0000 Subject: [PATCH] Coverity CID 2855: If fin->fin_fr is NULL, return 0, don't crash. --- sys/dist/ipf/netinet/ip_auth.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dist/ipf/netinet/ip_auth.c b/sys/dist/ipf/netinet/ip_auth.c index e0c15c5926db..fedb5eecdbb4 100644 --- a/sys/dist/ipf/netinet/ip_auth.c +++ b/sys/dist/ipf/netinet/ip_auth.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_auth.c,v 1.5 2006/04/04 16:17:19 martti Exp $ */ +/* $NetBSD: ip_auth.c,v 1.6 2006/04/13 18:59:58 christos Exp $ */ /* * Copyright (C) 1998-2003 by Darren Reed & Guido van Rooij. @@ -121,7 +121,7 @@ extern struct ifqueue ipintrq; /* ip packet input queue */ #if !defined(lint) #if defined(__NetBSD__) #include -__KERNEL_RCSID(0, "$NetBSD: ip_auth.c,v 1.5 2006/04/04 16:17:19 martti Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_auth.c,v 1.6 2006/04/13 18:59:58 christos Exp $"); #else static const char rcsid[] = "@(#)Id: ip_auth.c,v 2.73.2.13 2006/03/29 11:19:55 darrenr Exp"; #endif @@ -303,6 +303,9 @@ fr_info_t *fin; if (fr_auth_lock) return 0; + if (fin->fin->fr == NULL) + return 0; + WRITE_ENTER(&ipf_auth); if (fr_authstart > fr_authend) { fr_authstats.fas_nospace++;