From 5c04643423e44d47b66d6ca98faf8341ba26daa7 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 13 Jan 2010 23:45:15 +0000 Subject: 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 --- sys/net/pf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3