Changeset 236528 in webkit
- Timestamp:
- Sep 26, 2018, 2:58:29 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/URLParser.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r236527 r236528 1 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 3 URLs with mismatched surrogate pairs in the host should fail to parse 4 https://bugs.webkit.org/show_bug.cgi?id=190005 5 6 Reviewed by Chris Dumez. 7 8 Elsewhere in the URLParser, when we encounter mismatched surrogate pairs we use the replacement character, 9 but that just fails later on in domainToASCII, so we may as well just fail. 10 This behavior matches Chrome, but is unclear in the spec. There are no valid uses of hosts containing mismatched surrogate pairs. 11 Covered by new API tests. 12 13 * platform/URLParser.cpp: 14 (WebCore::URLParser::parseHostAndPort): 15 1 16 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebCore/platform/URLParser.cpp
r236527 r236528 2754 2754 syntaxViolation(hostBegin); 2755 2755 2756 if (!U_IS_UNICODE_CHAR(*iterator)) 2757 return false; 2756 2758 uint8_t buffer[U8_MAX_LENGTH]; 2757 2759 int32_t offset = 0; 2758 UBool error = false; 2759 U8_APPEND(buffer, offset, U8_MAX_LENGTH, *iterator, error); 2760 ASSERT_WITH_SECURITY_IMPLICATION(offset <= static_cast<int32_t>(sizeof(buffer))); 2761 // FIXME: Check error. 2760 U8_APPEND_UNSAFE(buffer, offset, *iterator); 2762 2761 utf8Encoded.append(buffer, offset); 2763 2762 } -
trunk/Tools/ChangeLog
r236524 r236528 1 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 3 URLs with mismatched surrogate pairs in the host should fail to parse 4 https://bugs.webkit.org/show_bug.cgi?id=190005 5 6 Reviewed by Chris Dumez. 7 8 * TestWebKitAPI/Tests/WebCore/URLParser.cpp: 9 (TestWebKitAPI::TEST_F): 10 1 11 2018-09-26 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp
r233789 r236528 1258 1258 const wchar_t validSurrogateEnd = 0xDD55; 1259 1259 const wchar_t invalidSurrogateEnd = 'A'; 1260 const wchar_t replacementCharacter = 0xFFFD; 1260 1261 checkURL(utf16String<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, validSurrogateEnd, '\0'}), 1261 1262 {"http", "", "", "w", 0, "/%F0%90%85%95", "", "", "http://w/%F0%90%85%95"}, testTabsValueForSurrogatePairs); 1262 1263 shouldFail(utf16String<10>({'h', 't', 't', 'p', ':', '/', surrogateBegin, invalidSurrogateEnd, '/', '\0'})); 1264 shouldFail(utf16String<9>({'h', 't', 't', 'p', ':', '/', replacementCharacter, '/', '\0'})); 1265 1263 1266 // URLParser matches Chrome and Firefox but not URL::parse. 1264 1267 checkURLDifferences(utf16String<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, invalidSurrogateEnd}),
Note:
See TracChangeset
for help on using the changeset viewer.