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

Unified Diff: ipc/ipc_mojo_bootstrap.cc

Issue 2834493008: Fix null pointer dereference in ipc_boostrap (Closed)
Patch Set: Created 3 years, 8 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_mojo_bootstrap.cc
diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc
index 2c554620e9d67b25c437202929b494397cfd2167..89a74343f811b89c5f4bc243814912aaab8c29fb 100644
--- a/ipc/ipc_mojo_bootstrap.cc
+++ b/ipc/ipc_mojo_bootstrap.cc
@@ -788,6 +788,12 @@ class ChannelAssociatedGroupController
if (!endpoint)
return;
+ // Careful, if the endpoint is detached its members are cleared. Check for
+ // that before dereferencing.
+ mojo::InterfaceEndpointClient* client = endpoint->client();
+ if (!client)
+ return;
+
DCHECK(endpoint->task_runner()->BelongsToCurrentThread());
MessageWrapper message_wrapper = endpoint->PopSyncMessage(message_id);
@@ -796,10 +802,6 @@ class ChannelAssociatedGroupController
if (message_wrapper.value().IsNull())
return;
- mojo::InterfaceEndpointClient* client = endpoint->client();
- if (!client)
- return;
-
bool result = false;
{
base::AutoUnlock unlocker(lock_);
« 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