From: Rongqi Sun Date: Wed, 17 Apr 2024 03:03:43 +0000 (+0000) Subject: bluestore/bluestore_types: avoid heap-buffer-overflow in another way to keep code... X-Git-Tag: v18.2.5~328^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=59534903ebad47e6f2bd9aa9bcc57a1d8a7a14e6;p=ceph.git bluestore/bluestore_types: avoid heap-buffer-overflow in another way to keep code uniformity Signed-off-by: Rongqi Sun (cherry picked from commit 8564caf393a8fe6ef1bb1741a399ab264397648c) Conflicts: src/os/bluestore/bluestore_types.h - No 'aux_items.end' check in reef --- diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 4c96e8903260..e9b0d47eff35 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -1310,7 +1310,7 @@ struct sb_info_space_efficient_map_t { if (aux_items.size() != 0) { auto it = std::lower_bound( aux_items.begin(), - aux_items.end(), + aux_items.end() - 1, id, [](const sb_info_t& a, const uint64_t& b) { return a < b;