Commit 072086f8 authored by Dominik Charousset's avatar Dominik Charousset

Fix memory corruption in upstream messages

parent e958fb43
...@@ -150,8 +150,11 @@ void inbound_path::emit_regular_shutdown(local_actor* self) { ...@@ -150,8 +150,11 @@ void inbound_path::emit_regular_shutdown(local_actor* self) {
void inbound_path::emit_irregular_shutdown(local_actor* self, error reason) { void inbound_path::emit_irregular_shutdown(local_actor* self, error reason) {
CAF_LOG_TRACE(CAF_ARG(slots) << CAF_ARG(reason)); CAF_LOG_TRACE(CAF_ARG(slots) << CAF_ARG(reason));
unsafe_send_as(self, hdl, /// Note that we always send abort messages anonymous. They can get send
make<upstream_msg::forced_drop>( /// after `self` already terminated and we must not form strong references
/// after that point. Since upstream messages contain the sender address
/// anyway, we only omit redundant information anyways.
anon_send(hdl, make<upstream_msg::forced_drop>(
slots.invert(), self->address(), std::move(reason))); slots.invert(), self->address(), std::move(reason)));
} }
...@@ -159,8 +162,9 @@ void inbound_path::emit_irregular_shutdown(local_actor* self, ...@@ -159,8 +162,9 @@ void inbound_path::emit_irregular_shutdown(local_actor* self,
stream_slots slots, stream_slots slots,
const strong_actor_ptr& hdl, const strong_actor_ptr& hdl,
error reason) { error reason) {
unsafe_send_as(self, hdl, /// Note that we always send abort messages anonymous. See reasoning in first
make<upstream_msg::forced_drop>( /// function overload.
anon_send(hdl, make<upstream_msg::forced_drop>(
slots.invert(), self->address(), std::move(reason))); slots.invert(), self->address(), std::move(reason)));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment