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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 8142009: Add a second line of defense for receiving a bad message in the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | content/renderer/render_view.cc » ('j') | content/renderer/render_view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index d4d1ccbf1655dbbcc5c47eb314ecd33d05ba2648..c451cc96d8719564b5ec5415426f17ed45cb0cc4 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -573,15 +573,15 @@ bool TabContents::NavigateToPendingEntry(
bool TabContents::NavigateToEntry(
const NavigationEntry& entry,
NavigationController::ReloadType reload_type) {
- RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry);
- if (!dest_render_view_host)
- return false; // Unable to create the desired render view host.
-
// The renderer will reject IPC messages with URLs longer than
// this limit, so don't attempt to navigate with a longer URL.
if (entry.url().spec().size() > content::kMaxURLChars)
return false;
+ RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry);
+ if (!dest_render_view_host)
+ return false; // Unable to create the desired render view host.
+
// For security, we should never send non-Web-UI URLs to a Web UI renderer.
// Double check that here.
int enabled_bindings = dest_render_view_host->enabled_bindings();
« no previous file with comments | « no previous file | content/renderer/render_view.cc » ('j') | content/renderer/render_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698