]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: Fix dereference of empty optional 18868/head
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 27 Oct 2017 19:57:18 +0000 (15:57 -0400)
committerShinobu Kinjo <shinobu@redhat.com>
Fri, 10 Nov 2017 07:10:11 +0000 (02:10 -0500)
commit2dc009e68ef9e850aebcc55634a1505212786309
tree21494978b228fb816fa4aecf18dd7d8e1e176a4e
parenta7c8c8101d4b78b4d6e437620b2c1a38cd752c3f
rgw: Fix dereference of empty optional

Due to the lack of a return, there was a case where an invalid ARN
could cause a dereference of an uninitialized boost::optional.

As a bit of defensive programming, restructure a couple functions to
make that kind of error impossible by ensuring the optional is only in
scope when it is initialized and relying less in early return on
error.

Fixes: http://tracker.ceph.com/issues/21962
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 5249139be7a2748eabbf898cf340989875bfa509)
src/rgw/rgw_iam_policy.cc