]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: check NULL before dereference
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 27 Sep 2012 22:27:00 +0000 (15:27 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 8 Oct 2012 22:12:52 +0000 (15:12 -0700)
Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_acl_s3.cc

index 3680bc4cc1ff17531041f1c9ea0cd7c6f2d8b8fd..e1c81e73ac8d3ba9c0330e195d7a125cf48b983c 100644 (file)
@@ -300,6 +300,9 @@ bool RGWAccessControlList_S3::create_canned(string id, string name, string canne
 bool RGWAccessControlPolicy_S3::xml_end(const char *el) {
   RGWAccessControlList_S3 *s3acl =
       (RGWAccessControlList_S3 *)find_first("AccessControlList");
+  if (!s3acl)
+    return false;
+
   acl = *s3acl;
 
   ACLOwner *owner_p = (ACLOwner_S3 *)find_first("Owner");