Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: ipc/ipc_channel_mojo.cc

Issue 2682223005: Fix nullptr dereference in thread-safe Channel forwarding (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_mojo.cc
diff --git a/ipc/ipc_channel_mojo.cc b/ipc/ipc_channel_mojo.cc
index 3d5e8553a658bb84c27dbf04bcdcfb5662c35644..c8baa42053dd255293837db860a687f0640fb275 100644
--- a/ipc/ipc_channel_mojo.cc
+++ b/ipc/ipc_channel_mojo.cc
@@ -283,7 +283,7 @@ ChannelMojo::ChannelMojo(
void ChannelMojo::ForwardMessageFromThreadSafePtr(mojo::Message message) {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
- if (!message_reader_)
+ if (!message_reader_ || !message_reader_->sender().is_bound())
return;
message_reader_->sender().internal_state()->ForwardMessage(
std::move(message));
@@ -293,7 +293,7 @@ void ChannelMojo::ForwardMessageWithResponderFromThreadSafePtr(
mojo::Message message,
std::unique_ptr<mojo::MessageReceiver> responder) {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
- if (!message_reader_)
+ if (!message_reader_ || !message_reader_->sender().is_bound())
return;
message_reader_->sender().internal_state()->ForwardMessageWithResponder(
std::move(message), std::move(responder));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698