diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 23:32:57 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 23:32:57 +0000 |
commit | c5a7248b45656b1ca63f9ce35b60ca337f83d3d1 (patch) | |
tree | 0f6f50e96e99046d820d9b49ccea1294244b7c2a /net | |
parent | df2c7403503b45467d3d76ddc2f42296fa53ac50 (diff) | |
download | chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.zip chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.tar.gz chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.tar.bz2 |
Fixes to the string MatchPattern functions:
1) Make it explicit that it only supports ASCII (since it iterates
character by character).
2) Limit the recursion to 16 levels. We could allow more, but in the
case of a ?, it has exponential complexity, so I figured 16 was a good
stopping point. It seems rare that someone would have more than 16
'?' and '*'s.
BUG=28645
Review URL: http://codereview.chromium.org/460047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/mock_host_resolver.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_config.cc | 3 | ||||
-rw-r--r-- | net/proxy/proxy_service.cc | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index 46772b3..a17ac80 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -189,7 +189,7 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, r->address_family == ADDRESS_FAMILY_UNSPECIFIED || r->address_family == address_family; - if (matches_address_family && MatchPattern(host, r->host_pattern)) { + if (matches_address_family && MatchPatternASCII(host, r->host_pattern)) { if (r->latency_ms != 0) PlatformThread::Sleep(r->latency_ms); diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc index a1aa92c..836559e 100644 --- a/net/proxy/proxy_config.cc +++ b/net/proxy/proxy_config.cc @@ -121,7 +121,8 @@ void ProxyConfig::ParseNoProxyList(const std::string& no_proxy) { // A single "*" is specifically allowed and unproxies anything. // "*" wildcards other than a single "*" entry are not universally // supported. We will support them, as we get * wildcards for free - // (see MatchPattern() called from ProxyService::ShouldBypassProxyForURL()). + // (see MatchPatternASCII() called from + // ProxyService::ShouldBypassProxyForURL()). // no_proxy is a comma-separated list of <trailing_domain>[:<port>]. // If no port is specified then any port matches. // The historical definition has trailing_domain match using a simple diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index dc97d47..7acde10 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -740,7 +740,7 @@ bool ProxyService::ShouldBypassProxyForURL(const GURL& url) { StringToLowerASCII(&bypass_url_domain); - if (MatchPattern(*url_compare_reference, bypass_url_domain)) + if (MatchPatternASCII(*url_compare_reference, bypass_url_domain)) return true; // Some systems (the Mac, for example) allow CIDR-style specification of |