RESOLVED FIXED 167773
URLParser: Fix parsing invalid IPv4 addresses with non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=167773
Summary URLParser: Fix parsing invalid IPv4 addresses with non-ASCII characters
Alex Christensen
Reported 2017-02-02 19:08:28 PST
URLParser: Fix parsing invalid IPv4 addresses with non-ASCII characters
Attachments
Patch (7.20 KB, patch)
2017-02-02 19:16 PST, Alex Christensen
rniwa: review+
Alex Christensen
Comment 1 2017-02-02 19:16:40 PST
Ryosuke Niwa
Comment 2 2017-02-02 22:20:25 PST
Comment on attachment 300484 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300484&action=review > Source/WebCore/platform/URLParser.cpp:2580 > + const auto hostBegin = iterator; > + Why does moving this declaration make sense? > Source/WebCore/platform/URLParser.cpp:2637 > - if (auto address = parseIPv4Host(CodePointIterator<CharacterType>(hostIterator, iterator))) { > + if (auto address = parseIPv4Host(hostBegin, CodePointIterator<CharacterType>(hostIterator, iterator))) { This whole if (LIKELY(!m_hostHasPercentOrNonASCII)) will exit. > Source/WebCore/platform/URLParser.cpp:-2663 > - > - auto hostBegin = iterator; > - Before we ever execute code beneath this. I think it's cleaner to create a local variable inside LIKELY(!m_hostHasPercentOrNonASCII) instead.
Alex Christensen
Comment 3 2017-02-02 22:32:07 PST
Note You need to log in before you can comment on or make changes to this bug.