]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: Fix dereference of empty optional 18602/head
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 27 Oct 2017 19:57:18 +0000 (15:57 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 27 Oct 2017 22:26:11 +0000 (18:26 -0400)
commit5249139be7a2748eabbf898cf340989875bfa509
tree588332c920f50503da5978e46de20acccc80dfab
parentf94322066f05e96793a542527edfa9c5cd4e4093
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>
src/rgw/rgw_iam_policy.cc