From: Adam C. Emerson Date: Mon, 7 Aug 2017 21:46:38 +0000 (-0400) Subject: rgw: Fix the last policy use-after-free X-Git-Tag: v13.0.0~212^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16823%2Fhead;p=ceph.git rgw: Fix the last policy use-after-free Signed-off-by: Adam C. Emerson --- diff --git a/src/rgw/rgw_iam_policy.cc b/src/rgw/rgw_iam_policy.cc index 157b60559c9..28b97d04d5c 100644 --- a/src/rgw/rgw_iam_policy.cc +++ b/src/rgw/rgw_iam_policy.cc @@ -700,8 +700,9 @@ bool ParseState::key(const char* s, size_t l) { if (w->kind == TokenKind::cond_op) { auto id = w->id; auto& t = pp->policy.statements.back(); + auto c_ife = cond_ifexists; pp->s.emplace_back(pp, cond_key); - t.conditions.emplace_back(id, s, l, cond_ifexists); + t.conditions.emplace_back(id, s, l, c_ife); return true; } else { return false;