WebKit Bugzilla
Attachment 373729 Details for
Bug 199624
: Remove invalid assertion in URLParser::domainToASCII
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199624-20190709101945.patch (text/plain), 4.62 KB, created by
Alex Christensen
on 2019-07-09 10:19:46 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-07-09 10:19:46 PDT
Size:
4.62 KB
patch
obsolete
>Subversion Revision: 247246 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 911926796b3dba72ab8273a51f46579fef522bf3..dd27b201a8973116783700036d9ed88addbcf126 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,20 @@ >+2019-07-09 Alex Christensen <achristensen@webkit.org> >+ >+ Remove invalid assertion in URLParser::domainToASCII >+ https://bugs.webkit.org/show_bug.cgi?id=199624 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a non-ASCII domain's punycode encoding is longer than 63 characters, >+ the URL is supposed to fail to parse, according to https://www.unicode.org/reports/tr46/#ToASCII >+ We and all other browsers do this. When uidna_nameToASCII tries to punycode encode such a domain, >+ it can return a number larger than 63. In this case, processingDetails.errors is UIDNA_ERROR_LABEL_TOO_LONG >+ and we fail to parse as desired and uidna_nameToASCII did not write out of bounds, so it was just the assertion >+ that was wrong. I added some unit tests that would have hit the assertion and verify that we fail at the correct length. >+ >+ * wtf/URLParser.cpp: >+ (WTF::URLParser::domainToASCII): >+ > 2019-07-08 Chris Dumez <cdumez@apple.com> > > Use WeakHashSet for WebUserContentControllerProxy::m_processes >diff --git a/Source/WTF/wtf/URLParser.cpp b/Source/WTF/wtf/URLParser.cpp >index cdfc0f82160d5d7985f5d01d19b2449b1d050c73..032a81d4e11498cedfe0bfaed286d65fe94d8fe3 100644 >--- a/Source/WTF/wtf/URLParser.cpp >+++ b/Source/WTF/wtf/URLParser.cpp >@@ -2565,13 +2565,16 @@ template<typename CharacterType> Optional<URLParser::LCharBuffer> URLParser::dom > UErrorCode error = U_ZERO_ERROR; > UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; > int32_t numCharactersConverted = uidna_nameToASCII(&internationalDomainNameTranscoder(), StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, maxDomainLength, &processingDetails, &error); >- ASSERT(numCharactersConverted <= static_cast<int32_t>(maxDomainLength)); > > if (U_SUCCESS(error) && !processingDetails.errors) { >+#if ASSERT_DISABLED >+ UNUSED_PARAM(numCharactersConverted); >+#else > for (int32_t i = 0; i < numCharactersConverted; ++i) { > ASSERT(isASCII(hostnameBuffer[i])); > ASSERT(!isASCIIUpper(hostnameBuffer[i])); > } >+#endif > ascii.append(hostnameBuffer, numCharactersConverted); > if (domain != StringView(ascii.data(), ascii.size())) > syntaxViolation(iteratorForSyntaxViolationPosition); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index d09b05553bf7e20a71aae9d86a5d74ff1fa63d15..fe96c8432117db3f099cc4a705ef26296ea2a583 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2019-07-09 Alex Christensen <achristensen@webkit.org> >+ >+ Remove invalid assertion in URLParser::domainToASCII >+ https://bugs.webkit.org/show_bug.cgi?id=199624 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WTF/URLParser.cpp: >+ (TestWebKitAPI::TEST_F): >+ > 2019-07-08 Fujii Hironori <Hironori.Fujii@sony.com> > > JSTestGlobalObject.cpp of bindings-generation-tests is failing for Windows Python >diff --git a/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp b/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp >index cbd3f1f449a8635230bb9981b84e1b8e6a8d78ff..ea5dd4b819ca252e2f33bef8ba498eb121b8ae0e 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp >@@ -776,8 +776,11 @@ TEST_F(WTF_URLParser, ParserDifferences) > checkURLDifferences("http://abcd%7Xefg", > {"", "", "", "", 0, "", "", "", "http://abcd%7Xefg"}, > {"http", "", "", "abcd%7xefg", 0, "/", "", "", "http://abcd%7xefg/"}); >+ checkURL("ws://äAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", {"ws", "", "", "xn--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-rsb254a", 0, "/", "", "", "ws://xn--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-rsb254a/"}, TestTabs::No); >+ shouldFail("ws://äAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); >+ checkURL("ws://&äAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", {"ws", "", "", "xn--&aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-ssb254a", 0, "/", "", "", "ws://xn--&aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-ssb254a/"}, TestTabs::No); >+ shouldFail("ws://&äAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); > >- > // URLParser matches Chrome and the spec, but not URL::parse or Firefox. > checkURLDifferences(utf16String(u"http://ï¼ï¼¸ï½ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼"), > {"http", "", "", "192.168.0.1", 0, "/", "", "", "http://192.168.0.1/"},
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
beidson
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199624
: 373729