]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix use after free in IAM policy parser
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 24 Jul 2017 20:10:11 +0000 (16:10 -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 9320fd50d779f32487eacd5ffbd976a93a0ecb5c..309b3bab5a36e742abdbbad34fcde4462c9d8cd5 100644 (file)
@@ -688,9 +688,10 @@ bool ParseState::key(const char* s, size_t l) {
 
   if (!k) {
     if (w->kind == TokenKind::cond_op) {
+      auto id = w->id;
       auto& t = pp->policy.statements.back();
       pp->s.emplace_back(pp, cond_key);
-      t.conditions.emplace_back(w->id, s, l, cond_ifexists);
+      t.conditions.emplace_back(id, s, l, cond_ifexists);
       return true;
     } else {
       return false;