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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 10820017: Adds a check to ensure that a NULL pointer from RenderViewHostImpl::FromID() is not dereferenced (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK(opener) --> if (opener) { /* code */ } Created 8 years, 5 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/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index e60da1afb4c06e82896ce063b1c9829e5f427553..6678c11f44546c41a401fc1e1e226bd1bc0ae921 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -1038,10 +1038,12 @@ void RenderViewHostImpl::OnMsgRunModal(int opener_id, IPC::Message* reply_msg) {
RenderViewHostImpl* opener =
RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_);
- opener->StopHangMonitorTimeout();
- // The ack for the mouse down won't come until the dialog closes, so fake it
- // so that we don't get a timeout.
- opener->decrement_in_flight_event_count();
+ if (opener) {
+ opener->StopHangMonitorTimeout();
+ // The ack for the mouse down won't come until the dialog closes, so fake it
+ // so that we don't get a timeout.
+ opener->decrement_in_flight_event_count();
+ }
// TODO(darin): Bug 1107929: Need to inform our delegate to show this view in
// an app-modal fashion.
« 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