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 eb722c4fd34e0a5855c842a6a45c6e6df62f3716..d58fc5f6feb0a2960474cc4868737017ab957b5e 100644 |
--- a/content/browser/frame_host/navigator_impl.cc |
+++ b/content/browser/frame_host/navigator_impl.cc |
@@ -302,6 +302,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: " |