Reset reaper state to monostate in the async and threaded case.
Fixes a possible use after free in the async reaper case.
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@clyso.com>
On-behalf-of: SAP marcel.lauhoff@sap.com
ceph_assert(cache);
std::visit(
fu2::overload(
- [](const std::monostate& mono) {},
+ [](const std::monostate&) {},
[](AsyncState& async_state) {
boost::asio::dispatch(
async_state.strand,
if (e.code() != std::future_errc::no_state) throw;
}
},
- [&](const std::jthread&) { reaper_state.emplace<std::monostate>(); }),
+ [](const std::jthread&) {}),
reaper_state);
+ reaper_state.emplace<std::monostate>();
}
void KMSCache::clear_cache() const {