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: v16.2.13~36^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=98dd3fb9d800f818e9b9930a21957782181f4b1a;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 (cherry picked from commit 91ff9591b095e8e73e4dff5c4a3fe3c66c0de9b6) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 075a0944c6e..f62e3687ec5 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7269,9 +7269,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 */