| Summary: | URLParser should fail to parse URLs with hosts containing invalid punycode encodings | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||
| Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, darin, ews-watchlist, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Alex Christensen
2020-10-03 15:54:25 PDT
Created attachment 410445 [details]
Patch
Comment on attachment 410445 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410445&action=review > Source/WTF/wtf/URLParser.cpp:2514 > + if (domain.isAllASCII() && !domain.startsWithIgnoringASCIICase("xn--")) { This can use the simpler, more efficient startsWithLettersIgnoringASCIICase. And there is a version that works on StringImpl& so there is no need to change the argument type: if (domain.isAllASCII() && !startWithLettersIgnoringASCIICase(domain, "xn--")) { The name says "letters", but it also works correctly with other ASCII characters in the 0x20-0x3F and 0x60-0x7F ranges, which includes "-". |