]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/crypt: don't deref null manifest_bl 53590/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 13 Sep 2023 20:30:03 +0000 (16:30 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 21 Sep 2023 21:47:29 +0000 (17:47 -0400)
with dbstore, the manifest_bl pointer was null; check for null before
dereferencing for read_manifest_parts()

Fixes: https://tracker.ceph.com/issues/62378
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 04d9ea6dafb9ab0d71888b5ac9b1317c111e41ec)

src/rgw/rgw_rest_s3.cc

index d16bf7f4c4a3a436cffb90e449ec5a8054c6bc61..adf5cace3f4d0ca6bc11766b8d69843a300dd09c 100644 (file)
@@ -615,7 +615,7 @@ int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr<RGWGetObj_Filter>
       ldpp_dout(this, 1) << "failed to decode RGW_ATTR_CRYPT_PARTS" << dendl;
       return -EIO;
     }
-  } else {
+  } else if (manifest_bl) {
     // otherwise, we read the part lengths from the manifest
     res = RGWGetObj_BlockDecrypt::read_manifest_parts(this, *manifest_bl,
                                                       parts_len);
@@ -2788,7 +2788,7 @@ int RGWPutObj_ObjStore_S3::get_decrypt_filter(
       ldpp_dout(this, 1) << "failed to decode RGW_ATTR_CRYPT_PARTS" << dendl;
       return -EIO;
     }
-  } else {
+  } else if (manifest_bl) {
     // otherwise, we read the part lengths from the manifest
     res = RGWGetObj_BlockDecrypt::read_manifest_parts(this, *manifest_bl,
                                                       parts_len);