From: Casey Bodley Date: Wed, 13 Sep 2023 20:30:03 +0000 (-0400) Subject: rgw/crypt: don't deref null manifest_bl X-Git-Tag: v18.2.1~241^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53590%2Fhead;p=ceph.git rgw/crypt: don't deref null manifest_bl 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 (cherry picked from commit 04d9ea6dafb9ab0d71888b5ac9b1317c111e41ec) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index d16bf7f4c4a..adf5cace3f4 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -615,7 +615,7 @@ int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr 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);