Changeset 244035 in webkit
- Timestamp:
- Apr 8, 2019, 1:24:34 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/cocoa/NetworkProcessCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244033 r244035 1 2019-04-08 Brent Fulgham <bfulgham@apple.com> 2 3 Make HSTS list handling more robust against unexpected content 4 https://bugs.webkit.org/show_bug.cgi?id=196552 5 <rdar://problem/43403817> 6 7 Reviewed by Chris Dumez. 8 9 Crash logs indicate we sometimes encounter null key values during processing. 10 This patch adds some debug assertions to catch this in test environments, and 11 allows the code to skip the bad entries if encountered. 12 13 It also avoids calling CFDictionaryApplyFunction when the HSTS policies returned 14 by _CFNetworkCopyHSTSPolicies is nullptr, which is a possible return value. 15 16 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: 17 (WebKit::filterPreloadHSTSEntry): 18 (WebKit::NetworkProcess::getHostNamesWithHSTSCache): 19 1 20 2019-04-05 Brian Burg <bburg@apple.com> 2 21 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
r243427 r244035 150 150 static void filterPreloadHSTSEntry(const void* key, const void* value, void* context) 151 151 { 152 HashSet<String>* hostnames = static_cast<HashSet<String>*>(context); 152 RELEASE_ASSERT(context); 153 154 ASSERT(key); 155 ASSERT(value); 156 if (!key || !value) 157 return; 158 159 ASSERT(key != kCFNull); 160 if (key == kCFNull) 161 return; 162 163 auto* hostnames = static_cast<HashSet<String>*>(context); 153 164 auto val = static_cast<CFDictionaryRef>(value); 154 165 if (CFDictionaryGetValue(val, _kCFNetworkHSTSPreloaded) != kCFBooleanTrue) … … 158 169 void NetworkProcess::getHostNamesWithHSTSCache(WebCore::NetworkStorageSession& session, HashSet<String>& hostNames) 159 170 { 160 auto HSTSPolicies = adoptCF(_CFNetworkCopyHSTSPolicies(session.platformSession()));161 CFDictionaryApplyFunction(HSTSPolicies.get(), filterPreloadHSTSEntry, &hostNames);171 if (auto HSTSPolicies = adoptCF(_CFNetworkCopyHSTSPolicies(session.platformSession()))) 172 CFDictionaryApplyFunction(HSTSPolicies.get(), filterPreloadHSTSEntry, &hostNames); 162 173 } 163 174
Note:
See TracChangeset
for help on using the changeset viewer.