summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relay_http.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-05-22 01:34:14 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-05-22 01:34:14 +0000
commit212b3ceaa9edd10ccf96f357f5f6a2d1addce1e0 (patch)
tree5054b941052d1b71b5d8df223e1bad03a2bb6bfd /usr.sbin/relayd/relay_http.c
parent1e477868006959403adac7d2e6f0de7af1dd49a6 (diff)
fix a non safe use of TAILQ_FOREACH with TAILQ_REMOVE
ok reyk@
Diffstat (limited to 'usr.sbin/relayd/relay_http.c')
-rw-r--r--usr.sbin/relayd/relay_http.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c
index 2fdb2d56a7a..557b5fd783a 100644
--- a/usr.sbin/relayd/relay_http.c
+++ b/usr.sbin/relayd/relay_http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay_http.c,v 1.46 2015/05/18 16:57:20 bluhm Exp $ */
+/* $OpenBSD: relay_http.c,v 1.47 2015/05/22 01:34:13 jsg Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -1376,7 +1376,7 @@ relay_match_actions(struct ctl_relay_event *cre, struct relay_rule *rule,
struct kvlist *matches, struct kvlist *actions)
{
struct rsession *con = cre->con;
- struct kv *kv;
+ struct kv *kv, *tmp;
/*
* Apply the following options instantly (action per match).
@@ -1395,7 +1395,7 @@ relay_match_actions(struct ctl_relay_event *cre, struct relay_rule *rule,
*/
if (matches == NULL) {
/* 'pass' or 'block' rule */
- TAILQ_FOREACH(kv, &rule->rule_kvlist, kv_rule_entry) {
+ TAILQ_FOREACH_SAFE(kv, &rule->rule_kvlist, kv_rule_entry, tmp) {
TAILQ_INSERT_TAIL(actions, kv, kv_action_entry);
TAILQ_REMOVE(&rule->rule_kvlist, kv, kv_rule_entry);
}