]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix the last policy use-after-free 16823/head
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 7 Aug 2017 21:46:38 +0000 (17:46 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 7 Aug 2017 21:48:37 +0000 (17:48 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_iam_policy.cc

index 157b60559c99988a54c5f19a2e75fe7b3538218e..28b97d04d5c3ee2918abd50d3c1243f83b6176a7 100644 (file)
@@ -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;