summaryrefslogtreecommitdiffstats
path: root/sys/net/pf_table.c
diff options
context:
space:
mode:
authormcbride <mcbride@openbsd.org>2004-06-11 05:21:20 +0000
committermcbride <mcbride@openbsd.org>2004-06-11 05:21:20 +0000
commitc17558ab2067ee6f0757ae9fa899b37598333198 (patch)
treecd7cca3e2e2d5314dacbeecad1e0d9a4163bc3b3 /sys/net/pf_table.c
parentCorrect the code that identifies bogus regexps; Jared Yanovich (diff)
downloadwireguard-openbsd-c17558ab2067ee6f0757ae9fa899b37598333198.tar.xz
wireguard-openbsd-c17558ab2067ee6f0757ae9fa899b37598333198.zip
Eliminate a dereference after pool_put when an inactive/no-longer referenced
table is destroyed in pfr_setflags_ktable. Fix from Chris Pascoe
Diffstat (limited to 'sys/net/pf_table.c')
-rw-r--r--sys/net/pf_table.c8
1 files 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