summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2010-01-13 23:45:15 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2010-01-13 23:45:15 +0000
commit5c04643423e44d47b66d6ca98faf8341ba26daa7 (patch)
tree18190e24a8d787d7840f06ca502f87260efc3a42
parent5b8bcbf6d72e107a0229225d75b10e34b25290e2 (diff)
in pf_state_key_detach, ensure that the state key pointer on the state
is not null, to be safe and to be able to call this with half setup states. with and ok ryan
-rw-r--r--sys/net/pf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 77176009854..cf28dbffe18 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.683 2010/01/12 03:20:51 mcbride Exp $ */
+/* $OpenBSD: pf.c,v 1.684 2010/01/13 23:45:14 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -788,6 +788,9 @@ pf_state_key_detach(struct pf_state *s, int idx)
{
struct pf_state_item *si;
+ if (&s->key[idx] == NULL)
+ return;
+
si = TAILQ_FIRST(&s->key[idx]->states);
while (si && si->s != s)
si = TAILQ_NEXT(si, entry);