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

Unified Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 2259753002: Fix nullptr dereference in MojoShellConnectionImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: content/common/mojo/mojo_shell_connection_impl.cc
diff --git a/content/common/mojo/mojo_shell_connection_impl.cc b/content/common/mojo/mojo_shell_connection_impl.cc
index 7528df61914d60213c96b637e043f7595d9ed956..e66aef0d1c0111775b07874b01d1287a032c2fc9 100644
--- a/content/common/mojo/mojo_shell_connection_impl.cc
+++ b/content/common/mojo/mojo_shell_connection_impl.cc
@@ -178,8 +178,10 @@ class MojoShellConnectionImpl::IOThreadContext
// Note that this method may be invoked by MessageLoopObserver observing
// MessageLoop destruction. In that case, this call to ShutDown is
// effectively a no-op. In any case it's safe.
- message_loop_observer_->ShutDown();
- message_loop_observer_ = nullptr;
+ if (message_loop_observer_) {
+ message_loop_observer_->ShutDown();
+ message_loop_observer_ = nullptr;
+ }
// Resetting the ServiceContext below may otherwise release the last
// reference to this IOThreadContext. We keep it alive until the stack
« 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