Skip to content

Commit 8564caf

Browse files
committed
bluestore/bluestore_types: avoid heap-buffer-overflow in another way to keep code uniformity
Signed-off-by: Rongqi Sun <[email protected]>
1 parent e1c9294 commit 8564caf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/os/bluestore/bluestore_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,12 +1377,12 @@ struct sb_info_space_efficient_map_t {
13771377
if (aux_items.size() != 0) {
13781378
auto it = std::lower_bound(
13791379
aux_items.begin(),
1380-
aux_items.end(),
1380+
aux_items.end() - 1,
13811381
id,
13821382
[](const sb_info_t& a, const uint64_t& b) {
13831383
return a < b;
13841384
});
1385-
if (it != aux_items.end() && it->get_sbid() == id) {
1385+
if (it->get_sbid() == id) {
13861386
return it;
13871387
}
13881388
}

0 commit comments

Comments
 (0)