diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 00:19:36 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 00:19:36 +0000 |
commit | 690d0a9175790c4bd3abd066932bc08203c164ca (patch) | |
tree | 087e5938da633cdcfa7d110023b21a5b37a21072 /chrome/browser/child_process_security_policy.cc | |
parent | d8debc51c55deb2df4fb08d28e98d6b4cb862e5d (diff) | |
download | chromium_src-690d0a9175790c4bd3abd066932bc08203c164ca.zip chromium_src-690d0a9175790c4bd3abd066932bc08203c164ca.tar.gz chromium_src-690d0a9175790c4bd3abd066932bc08203c164ca.tar.bz2 |
Avoid excessive nesting / recursion in browser URL handling.
BUG=31517
TEST=ChildProcessSecurityPolicyTest
Review URL: http://codereview.chromium.org/525038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_security_policy.cc')
-rw-r--r-- | chrome/browser/child_process_security_policy.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/child_process_security_policy.cc b/chrome/browser/child_process_security_policy.cc index 635e0cf..7f28d31 100644 --- a/chrome/browser/child_process_security_policy.cc +++ b/chrome/browser/child_process_security_policy.cc @@ -302,8 +302,14 @@ bool ChildProcessSecurityPolicy::CanRequestURL( if (url.SchemeIs(chrome::kViewSourceScheme) || url.SchemeIs(chrome::kPrintScheme)) { // View-source and print URL's are allowed if the renderer is permitted - // to request the embedded URL. - return CanRequestURL(renderer_id, GURL(url.path())); + // to request the embedded URL. Careful to avoid pointless recursion. + GURL child_url(url.path()); + if (child_url.SchemeIs(chrome::kPrintScheme) || + (child_url.SchemeIs(chrome::kViewSourceScheme) && + url.SchemeIs(chrome::kViewSourceScheme))) + return false; + + return CanRequestURL(renderer_id, child_url); } if (LowerCaseEqualsASCII(url.spec(), chrome::kAboutBlankURL)) |