Project

General

Profile

Actions

Cleanup #57938

open

relying on boost flatmap emplace behavior is risky

Added by Yuval Lifshitz over 1 year ago. Updated about 1 year ago.

Status:
Pending Backport
Priority:
Low
Assignee:
-
Target version:
-
% Done:

0%

Tags:
low-hanging-fruit backport_processed
Backport:
pacific quincy reef
Reviewed:
Affected Versions:
Pull request ID:

Description

see coverity issue: http://folio07.front.sepia.ceph.com/main/ceph-main-98d41855/cov-main-html/3/2253rgw_trim_bilog.cc.html#error
in "BucketTrimWatcher" we emplace a pointer into a boost flatmap without checking whether the operation was successful.
in case of boost flatmap, the ctor is called even if the emplace fails, so the operation does not leak. however, in std::map this is not the case and memory would leak.
see: https://godbolt.org/z/6nzP4T5fb


Related issues 5 (1 open4 closed)

Copied to rgw - Backport #59025: quincy: relying on boost flatmap emplace behavior is riskyIn ProgressKonstantin ShalyginActions
Copied to rgw - Backport #59026: pacific: relying on boost flatmap emplace behavior is riskyResolvedKonstantin ShalyginActions
Copied to rgw - Backport #59027: pacific: relying on boost flatmap emplace behavior is riskyDuplicateActions
Copied to rgw - Backport #59028: reef: relying on boost flatmap emplace behavior is riskyResolvedActions
Copied to rgw - Backport #59029: reef: relying on boost flatmap emplace behavior is riskyDuplicateActions
Actions

Also available in: Atom PDF