Changeset 206609 in webkit
- Timestamp:
- Sep 29, 2016, 1:21:54 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206608 r206609 1 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 3 URLParser: make parsing invalid IPv4 addresses more robust and correct 4 https://bugs.webkit.org/show_bug.cgi?id=162746 5 6 Reviewed by Tim Horton. 7 8 If parsing an IPv4 address fails, the characters are just treated as a regular domain. 9 10 Covered by new API tests. 11 12 * platform/URLParser.cpp: 13 (WebCore::URLParser::parseIPv4Number): 14 (WebCore::URLParser::parseIPv4Host): 15 1 16 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebCore/platform/URLParser.cpp
r206608 r206609 2044 2044 while (!iterator.atEnd()) { 2045 2045 if (*iterator == '.') { 2046 ++iterator;2047 2046 ASSERT(!value.hasOverflowed()); 2048 2047 return value.unsafeGet(); … … 2124 2123 else 2125 2124 return Nullopt; 2126 } 2127 if (!items.size() || items.size() > 4) 2125 if (!iterator.atEnd()) { 2126 if (items.size() >= 4) 2127 return Nullopt; 2128 if (*iterator == '.') 2129 ++iterator; 2130 else 2131 return Nullopt; 2132 } 2133 } 2134 if (!iterator.atEnd() || !items.size() || items.size() > 4) 2128 2135 return Nullopt; 2129 2136 if (items.size() > 2) { -
trunk/Tools/ChangeLog
r206608 r206609 1 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 3 URLParser: make parsing invalid IPv4 addresses more robust and correct 4 https://bugs.webkit.org/show_bug.cgi?id=162746 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WebCore/URLParser.cpp: 9 (TestWebKitAPI::TEST_F): 10 1 11 2016-09-29 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp
r206608 r206609 290 290 checkURL("http://\t//\\///user:@webkit.org:99?foo", {"http", "user", "", "webkit.org", 99, "/", "foo", "", "http://user@webkit.org:99/?foo"}); 291 291 checkURL("http:/\\user:@webkit.org:99?foo", {"http", "user", "", "webkit.org", 99, "/", "foo", "", "http://user@webkit.org:99/?foo"}); 292 checkURL("http://127.0.0.1", {"http", "", "", "127.0.0.1", 0, "/", "", "", "http://127.0.0.1/"}); 293 checkURL("http://127.0.0.1.", {"http", "", "", "127.0.0.1.", 0, "/", "", "", "http://127.0.0.1./"}); 294 checkURL("http://127.0.0.1./", {"http", "", "", "127.0.0.1.", 0, "/", "", "", "http://127.0.0.1./"}); 292 295 293 296 // This disagrees with the web platform test for http://:@www.example.com but agrees with Chrome and URL::parse, … … 749 752 {"", "", "", "", 0, "", "", "", "http://[1:2:3:4:5:6:7:::]/"}, 750 753 {"http", "", "", "[1:2:3:4:5:6:7:::]", 0, "/", "", "", "http://[1:2:3:4:5:6:7:::]/"}); 754 checkURLDifferences("http://127.0.0.1~/", 755 {"http", "", "", "127.0.0.1~", 0, "/", "", "", "http://127.0.0.1~/"}, 756 {"", "", "", "", 0, "", "", "", "http://127.0.0.1~/"}); 757 checkURLDifferences("http://127.0.1~/", 758 {"http", "", "", "127.0.1~", 0, "/", "", "", "http://127.0.1~/"}, 759 {"", "", "", "", 0, "", "", "", "http://127.0.1~/"}); 760 checkURLDifferences("http://127.0.1./", 761 {"http", "", "", "127.0.0.1", 0, "/", "", "", "http://127.0.0.1/"}, 762 {"http", "", "", "127.0.1.", 0, "/", "", "", "http://127.0.1./"}); 763 checkURLDifferences("http://127.0.1.~/", 764 {"http", "", "", "127.0.1.~", 0, "/", "", "", "http://127.0.1.~/"}, 765 {"", "", "", "", 0, "", "", "", "http://127.0.1.~/"}); 766 checkURLDifferences("http://127.0.1.~", 767 {"http", "", "", "127.0.1.~", 0, "/", "", "", "http://127.0.1.~/"}, 768 {"", "", "", "", 0, "", "", "", "http://127.0.1.~"}); 751 769 } 752 770
Note:
See TracChangeset
for help on using the changeset viewer.