Title: [187610] branches/safari-601.1-branch/Source/WebCore
Revision
187610
Author
[email protected]
Date
2015-07-30 14:50:44 -0700 (Thu, 30 Jul 2015)

Log Message

Merge r187490. rdar://problem/21995928

Modified Paths

Diff

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187609 => 187610)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-30 21:22:47 UTC (rev 187609)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-30 21:50:44 UTC (rev 187610)
@@ -1,5 +1,20 @@
 2015-07-30  Matthew Hanson  <[email protected]>
 
+        Merge r187490. rdar://problem/21995928
+
+    2015-07-28  Brady Eidson  <[email protected]>
+
+            Handle null CFArrayRef returning from _CFHTTPParsedCookiesWithResponseHeaderFields.
+            <rdar://problem/21995928> and https://bugs.webkit.org/show_bug.cgi?id=147365
+
+            Reviewed by Alexey Proskuryakov.
+
+            * platform/network/cf/CookieJarCFNet.cpp:
+            (WebCore::filterCookies): ASSERT the input is not null.
+            (WebCore::createCookies): Always return a CFArrayRef, even if it's empty.
+
+2015-07-30  Matthew Hanson  <[email protected]>
+
         Merge r187278. rdar://problem/19908029
 
     2015-07-23  Nan Wang  <[email protected]>

Modified: branches/safari-601.1-branch/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp (187609 => 187610)


--- branches/safari-601.1-branch/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp	2015-07-30 21:22:47 UTC (rev 187609)
+++ branches/safari-601.1-branch/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp	2015-07-30 21:50:44 UTC (rev 187610)
@@ -80,6 +80,7 @@
 
 static RetainPtr<CFArrayRef> filterCookies(CFArrayRef unfilteredCookies)
 {
+    ASSERT(unfilteredCookies);
     CFIndex count = CFArrayGetCount(unfilteredCookies);
     RetainPtr<CFMutableArrayRef> filteredCookies = adoptCF(CFArrayCreateMutable(0, count, &kCFTypeArrayCallBacks));
     for (CFIndex i = 0; i < count; ++i) {
@@ -116,10 +117,14 @@
 static CFArrayRef createCookies(CFDictionaryRef headerFields, CFURLRef url)
 {
 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000)
-    return _CFHTTPParsedCookiesWithResponseHeaderFields(kCFAllocatorDefault, headerFields, url);
+    CFArrayRef parsedCookies = _CFHTTPParsedCookiesWithResponseHeaderFields(kCFAllocatorDefault, headerFields, url);
 #else
-    return CFHTTPCookieCreateWithResponseHeaderFields(kCFAllocatorDefault, headerFields, url);
+    CFArrayRef parsedCookies = CFHTTPCookieCreateWithResponseHeaderFields(kCFAllocatorDefault, headerFields, url);
 #endif
+    if (!parsedCookies)
+        parsedCookies = CFArrayCreate(kCFAllocatorDefault, 0, 0, &kCFTypeArrayCallBacks);
+
+    return parsedCookies;
 }
 
 void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const String& value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to