summaryrefslogtreecommitdiffstats
path: root/content/renderer/render_view_impl.cc
diff options
context:
space:
mode:
authornasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-02 02:15:08 +0000
committernasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-02 02:15:08 +0000
commit2bb45f5c12746649dd2b659e1cca8f0316f031bc (patch)
tree9e67316ae3c6f8fd3a34bac047856c1fe4877008 /content/renderer/render_view_impl.cc
parent3bbe556bbad79f7596015945e6d5449204b33389 (diff)
downloadchromium_src-2bb45f5c12746649dd2b659e1cca8f0316f031bc.zip
chromium_src-2bb45f5c12746649dd2b659e1cca8f0316f031bc.tar.gz
chromium_src-2bb45f5c12746649dd2b659e1cca8f0316f031bc.tar.bz2
Check sourceFrame before dereferencing during dispatching of postMessage.
BUG=275913 Review URL: https://codereview.chromium.org/55013002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_view_impl.cc')
-rw-r--r--content/renderer/render_view_impl.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 5f036a9..5176130 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -4309,13 +4309,15 @@ bool RenderViewImpl::willCheckAndDispatchMessageEvent(
params.message_port_ids = message_port_ids;
}
- // Include the routing ID for the source frame, which the browser process
- // will translate into the routing ID for the equivalent frame in the target
- // process.
+ // Include the routing ID for the source frame (if one exists), which the
+ // browser process will translate into the routing ID for the equivalent
+ // frame in the target process.
params.source_routing_id = MSG_ROUTING_NONE;
- RenderViewImpl* source_view = FromWebView(sourceFrame->view());
- if (source_view)
- params.source_routing_id = source_view->routing_id();
+ if (sourceFrame) {
+ RenderViewImpl* source_view = FromWebView(sourceFrame->view());
+ if (source_view)
+ params.source_routing_id = source_view->routing_id();
+ }
Send(new ViewHostMsg_RouteMessageEvent(routing_id_, params));
return true;