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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 2459913003: Drop navigations to NavigationEntry with invalid virtual URLs. (Closed)
Patch Set: Created 4 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 | « chrome/browser/chrome_navigation_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index da20883c6e642b56622b01c281bc649c558dacfc..88db45548466d37fc2fe781e53b7389c6a8fe2e9 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -292,6 +292,16 @@ bool NavigatorImpl::NavigateToEntry(
dest_referrer = Referrer();
}
+ // Don't attempt to navigate if the virtual URL is non-empty and invalid.
+ if (frame_tree_node->IsMainFrame()) {
+ const GURL& virtual_url = entry.GetVirtualURL();
+ if (!virtual_url.is_valid() && !virtual_url.is_empty()) {
+ LOG(WARNING) << "Refusing to load for invalid virtual URL: "
+ << virtual_url.possibly_invalid_spec();
+ return false;
+ }
+ }
+
// Don't attempt to navigate to non-empty invalid URLs.
if (!dest_url.is_valid() && !dest_url.is_empty()) {
LOG(WARNING) << "Refusing to load invalid URL: "
« no previous file with comments | « chrome/browser/chrome_navigation_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698