From 9c4986f1c98a06bcbf696119051f9b9f2c8d9ddc Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 13 Sep 2023 16:30:03 -0400 Subject: [PATCH] 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) --- src/rgw/rgw_rest_s3.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5