summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2007-11-07 17:28:41 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2007-11-07 17:28:41 +0000
commit90fc5313c59e4ca73eb2e890a32db8fe39ccc77e (patch)
tree867b7d63843f38b3d02fe0ba33a64647a8149cad
parent0fd6e349608b600e85b4abcd66b635e03325c93d (diff)
Check for pfi_kif's that are neither groups nor have a real interface.
This prevents a null-deref when empty groups are used in set loginterface. Fixes PR 5628 as reported by Andreas Bihlmaier. Bad mpf :( OK henning@
-rw-r--r--sys/net/pf_if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index bf71355a1e6..a3f62e1ea52 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.50 2007/09/27 22:24:05 mpf Exp $ */
+/* $OpenBSD: pf_if.c,v 1.51 2007/11/07 17:28:40 mpf Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
@@ -633,6 +633,8 @@ pfi_update_status(const char *name, struct pf_status *pfs)
bzero(pfs->bcounters, sizeof(pfs->bcounters));
}
TAILQ_FOREACH(ifgm, &ifg_members, ifgm_next) {
+ if (ifgm->ifgm_ifp == NULL)
+ continue;
p = (struct pfi_kif *)ifgm->ifgm_ifp->if_pf_kif;
/* just clear statistics */