From e03316ce38964a9bbf441a423cfa20ae881a9846 Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Fri, 11 Jun 2004 05:21:21 +0000 Subject: Eliminate a dereference after pool_put when an inactive/no-longer referenced table is destroyed in pfr_setflags_ktable. Fix from Chris Pascoe --- sys/net/pf_table.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index 6f95eb7b92b..c61571a6bb3 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.55 2004/06/07 13:16:19 cedric Exp $ */ +/* $OpenBSD: pf_table.c,v 1.56 2004/06/11 05:21:20 mcbride Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -1730,10 +1730,12 @@ pfr_insert_ktable(struct pfr_ktable *kt) void pfr_setflags_ktables(struct pfr_ktableworkq *workq) { - struct pfr_ktable *p; + struct pfr_ktable *p, *q; - SLIST_FOREACH(p, workq, pfrkt_workq) + for (p = SLIST_FIRST(workq); p; p = q) { + q = SLIST_NEXT(p, pfrkt_workq); pfr_setflags_ktable(p, p->pfrkt_nflags); + } } void -- cgit v1.2.3