diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-20 19:34:57 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-20 19:34:57 +0000 |
commit | 6aec56b2bafcf1bffd50a097b3f03688e66006e2 (patch) | |
tree | 5df8c9f980b78ca5421a1c241c38231d611d57a3 /net | |
parent | 98f0195af9685159e7b5dc77bed2ed4b1e965423 (diff) | |
download | chromium_src-6aec56b2bafcf1bffd50a097b3f03688e66006e2.zip chromium_src-6aec56b2bafcf1bffd50a097b3f03688e66006e2.tar.gz chromium_src-6aec56b2bafcf1bffd50a097b3f03688e66006e2.tar.bz2 |
CFNetworkExecuteProxyAutoConfigurationURL() chokes if the query url is NULL, and CFURL loves to be NULL when it can't parse something. Fixes a crash loading a horrific looking URL on espn.com
Review URL: http://codereview.chromium.org/50064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/proxy/proxy_resolver_mac.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/proxy/proxy_resolver_mac.cc b/net/proxy/proxy_resolver_mac.cc index 4ac2b18..48f0302 100644 --- a/net/proxy/proxy_resolver_mac.cc +++ b/net/proxy/proxy_resolver_mac.cc @@ -251,16 +251,20 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url, ProxyInfo* results) { scoped_cftyperef<CFStringRef> query_ref( base::SysUTF8ToCFStringRef(query_url.spec())); - scoped_cftyperef<CFStringRef> pac_ref( - base::SysUTF8ToCFStringRef(pac_url.spec())); scoped_cftyperef<CFURLRef> query_url_ref( CFURLCreateWithString(kCFAllocatorDefault, query_ref.get(), NULL)); + if (!query_url_ref.get()) + return ERR_FAILED; + scoped_cftyperef<CFStringRef> pac_ref( + base::SysUTF8ToCFStringRef(pac_url.spec())); scoped_cftyperef<CFURLRef> pac_url_ref( CFURLCreateWithString(kCFAllocatorDefault, pac_ref.get(), NULL)); + if (!pac_url_ref.get()) + return ERR_FAILED; // Work around <rdar://problem/5530166>. This dummy call to // CFNetworkCopyProxiesForURL initializes some state within CFNetwork that is |