view: apply_to_remote_endpoints: fix use-after-free

b815aa021c added a yield before
the trace point, causing the moved `frozen_mutation_and_schema`
(and `inet_address_vector_topology_change`) to drop out of scope
and be destroyed, as the rvalue-referenced objects aren't moved
onto the coroutine frame.

This change passes them by value rather than by rvalue-reference
so they will be stored in the coroutine frame.

Fixes #16540

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

Closes scylladb/scylladb#16541
This commit is contained in:
Benny Halevy
2023-12-24 21:21:58 +02:00
committed by Nadav Har'El
parent da033343b7
commit 060b16f987

View File

@@ -1606,8 +1606,8 @@ get_view_natural_endpoint(
}
static future<> apply_to_remote_endpoints(service::storage_proxy& proxy, locator::effective_replication_map_ptr ermp,
gms::inet_address target, inet_address_vector_topology_change&& pending_endpoints,
frozen_mutation_and_schema&& mut, const dht::token& base_token, const dht::token& view_token,
gms::inet_address target, inet_address_vector_topology_change pending_endpoints,
frozen_mutation_and_schema mut, const dht::token& base_token, const dht::token& view_token,
service::allow_hints allow_hints, tracing::trace_state_ptr tr_state) {
// The "delay_before_remote_view_update" injection point can be
// used to add a short delay (currently 0.5 seconds) before a base