]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/rgw/rgw_sync_checkpoint.cc: fix bug causing access a destructured temporary varia... 50282/head
authorMohamed Awnallah <mohamedmohey2352@gmail.com>
Mon, 27 Feb 2023 12:11:02 +0000 (14:11 +0200)
committerMohamed Awnallah <mohamedmohey2352@gmail.com>
Mon, 27 Feb 2023 12:11:02 +0000 (14:11 +0200)
This commit adds a static const empty string at `src/rgw/rgw_sync_checkpoint.cc`
that lives in the scope of the `empty` function to avoid access access a destructured temporary variable.

Fixes: https://tracker.ceph.com/issues/57516
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
src/rgw/rgw_sync_checkpoint.cc

index 5e05b0e1271c1edcc4c427284c2b0a0e6c726907..7ef6c3fc02b455b011b26d8e227a961af5537fdf 100644 (file)
@@ -49,8 +49,9 @@ bool operator<(const std::vector<rgw_bucket_shard_sync_info>& lhs,
 
 bool empty(const BucketIndexShardsManager& markers, int size)
 {
+  static const std::string empty_string;
   for (int i = 0; i < size; ++i) {
-    const auto& m = markers.get(i, "");
+    const auto& m = markers.get(i, empty_string);
     if (!m.empty()) {
       return false;
     }