Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=55165
Can call CF API with a null CFArray in WebResourceCacheManager

Reviewed by Adam Roben and looked at by Brian Weinstein.

* WebProcess/ResourceCache/WebResourceCacheManager.cpp:
(WebKit::WebResourceCacheManager::getCacheOrigins): cfURLCacheHostNames() can return a null CFArrayRef,
  so the call to CFArrayGetCount must be null checked.



Canonical link: https://commits.webkit.org/69516@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
beidson committed Feb 24, 2011
1 parent 0179e74 commit da88834
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,14 @@
2011-02-24 Brady Eidson <beidson@apple.com>

Reviewed by Adam Roben and looked at by Brian Weinstein.

https://bugs.webkit.org/show_bug.cgi?id=55165
Can call CF API with a null CFArray in WebResourceCacheManager

* WebProcess/ResourceCache/WebResourceCacheManager.cpp:
(WebKit::WebResourceCacheManager::getCacheOrigins): cfURLCacheHostNames() can return a null CFArrayRef,
so the call to CFArrayGetCount must be null checked.

2011-02-24 Anders Carlsson <andersca@apple.com>

Reviewed by Simon Fraser.
Expand Down
Expand Up @@ -66,8 +66,8 @@ void WebResourceCacheManager::getCacheOrigins(uint64_t callbackID) const
memoryCache()->getOriginsWithCache(origins);

#if USE(CFURLCACHE)
RetainPtr<CFArrayRef> cfURLHosts = cfURLCacheHostNames();
CFIndex size = CFArrayGetCount(cfURLHosts.get());
RetainPtr<CFArrayRef> cfURLHosts = cfURLCacheHostNames();
CFIndex size = cfURLHosts ? CFArrayGetCount(cfURLHosts.get()) : 0;

String httpString("http");
for (CFIndex i = 0; i < size; ++i) {
Expand Down

0 comments on commit da88834

Please sign in to comment.