Commit 00d59f5d authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Mojo: Ensure a RequestContext exists on async Channel error processing

If a channel error is triggered from off-thread and posted to the IPC
thread, we weren't ensuring that a RequestContext was in TLS. If the
error lead to event notifications this would cause a nullptr deref.

Fixes that.

BUG=752137
TBR=jcivelli@chromium.org

Change-Id: Iae167a712c9b7d8d853fe805c06afef36d2c4572
Reviewed-on: https://chromium-review.googlesource.com/600291Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491758}
parent 9a91d830
...@@ -1236,6 +1236,7 @@ void NodeController::OnAcceptPeer(const ports::NodeName& from_node, ...@@ -1236,6 +1236,7 @@ void NodeController::OnAcceptPeer(const ports::NodeName& from_node,
void NodeController::OnChannelError(const ports::NodeName& from_node, void NodeController::OnChannelError(const ports::NodeName& from_node,
NodeChannel* channel) { NodeChannel* channel) {
if (io_task_runner_->RunsTasksInCurrentSequence()) { if (io_task_runner_->RunsTasksInCurrentSequence()) {
RequestContext request_context(RequestContext::Source::SYSTEM);
DropPeer(from_node, channel); DropPeer(from_node, channel);
} else { } else {
io_task_runner_->PostTask( io_task_runner_->PostTask(
......
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