From: Cory Snyder Date: Mon, 12 Dec 2022 08:04:20 +0000 (-0500) Subject: rgw: fix dereference of empty std::optional in RGWDeleteMultiObj::execute() X-Git-Tag: v18.1.0~607^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=91ff9591b095e8e73e4dff5c4a3fe3c66c0de9b6;p=ceph.git rgw: fix dereference of empty std::optional in RGWDeleteMultiObj::execute() Fixes a crash that occurs when RGW is executed without an async context. Fixes: https://tracker.ceph.com/issues/58243 Signed-off-by: Cory Snyder --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 29552560b27c..81fb767d2a12 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7080,9 +7080,11 @@ void RGWDeleteMultiObj::execute(optional_yield y) handle_individual_object(obj_key, y, &*formatter_flush_cond); } } - wait_flush(y, &*formatter_flush_cond, [this, n=multi_delete->objects.size()] { - return n == ops_log_entries.size(); - }); + if (formatter_flush_cond) { + wait_flush(y, &*formatter_flush_cond, [this, n=multi_delete->objects.size()] { + return n == ops_log_entries.size(); + }); + } /* set the return code to zero, errors at this point will be dumped to the response */