From 28e3c6595dd888166efe4bcab92fe6ae0d7603bd Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 20 Dec 2011 11:15:15 +0100 Subject: [PATCH] Check if a config has been selected before narrowing selectors in quick mode --- src/libcharon/sa/ikev1/tasks/quick_mode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcharon/sa/ikev1/tasks/quick_mode.c b/src/libcharon/sa/ikev1/tasks/quick_mode.c index 9e71642af..df7b6375f 100644 --- a/src/libcharon/sa/ikev1/tasks/quick_mode.c +++ b/src/libcharon/sa/ikev1/tasks/quick_mode.c @@ -697,8 +697,11 @@ METHOD(task_t, process_r, status_t, this->tsi = this->tsr = NULL; this->config = peer_cfg->select_child_cfg(peer_cfg, tsr, tsi, me, other); - this->tsi = select_ts(this, FALSE, tsi); - this->tsr = select_ts(this, TRUE, tsr); + if (this->config) + { + this->tsi = select_ts(this, FALSE, tsi); + this->tsr = select_ts(this, TRUE, tsr); + } tsi->destroy_offset(tsi, offsetof(traffic_selector_t, destroy)); tsr->destroy_offset(tsr, offsetof(traffic_selector_t, destroy)); if (!this->config)