From: Adam C. Emerson Date: Mon, 11 Jul 2022 15:52:09 +0000 (-0400) Subject: CVE-2022-3854: rgw: Fix `rgw::sal::Bucket::empty` static method signatures X-Git-Tag: archive/raspbian/16.2.10+ds-5+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=77ed5979558107fd0c13434ee9ac0ecd795595d1;p=ceph.git CVE-2022-3854: rgw: Fix `rgw::sal::Bucket::empty` static method signatures Signed-off-by: Adam C. Emerson Fixes: https://tracker.ceph.com/issues/56586 Origin: upstream, https://github.com/ceph/ceph/pull/47194/commits/9746e8011ff1de6de7dba9c0041e28a16c8f6828.patch Bug-Debian: https://bugs.debian.org/1027151 Last-Update: 2022-01-09 `unique_ptr` overload should take by reference. Both should be const. Gbp-Pq: Name CVE-2022-3854_2_rgw_Fix_rgw_sal_Bucket_empty_static_method_signatures.patch --- diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 74c15ecdd..fcf015e0a 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -280,7 +280,11 @@ class RGWBucket { ent.convert(b); } - static bool empty(RGWBucket* b) { return (!b || b->empty()); } + /** Check if a Bucket pointer is empty */ + static bool empty(const RGWBucket* b) { return (!b || b->empty()); } + /** Check if a Bucket unique pointer is empty */ + static bool empty(const std::unique_ptr& b) { return (!b || b->empty()); } + virtual std::unique_ptr clone() = 0; /* dang - This is temporary, until the API is completed */