Changeset 245983 in webkit
- Timestamp:
- May 31, 2019, 1:56:40 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/URLParser.cpp (modified) (5 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r245982 r245983 1 2019-05-31 Alex Christensen <achristensen@webkit.org> 2 3 URLParser::parseIPv6Host should properly parse 0's around compression 4 https://bugs.webkit.org/show_bug.cgi?id=198424 5 6 Reviewed by Tim Horton. 7 8 * wtf/URLParser.cpp: 9 (WTF::URLParser::parseIPv6Host): 10 1 11 2019-05-31 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Source/WTF/wtf/URLParser.cpp
r245982 r245983 2402 2402 size_t piecePointer = 0; 2403 2403 Optional<size_t> compressPointer; 2404 bool previousValueWasZero = false; 2405 bool immediatelyAfterCompress = false; 2404 2406 2405 2407 if (*c == ':') { … … 2412 2414 ++piecePointer; 2413 2415 compressPointer = piecePointer; 2416 immediatelyAfterCompress = true; 2414 2417 } 2415 2418 … … 2423 2426 ++piecePointer; 2424 2427 compressPointer = piecePointer; 2428 immediatelyAfterCompress = true; 2429 if (previousValueWasZero) 2430 syntaxViolation(hostBegin); 2425 2431 continue; 2426 2432 } … … 2452 2458 } 2453 2459 2454 if (UNLIKELY((value && leadingZeros) || (!value && length > 1))) 2460 previousValueWasZero = !value; 2461 if (UNLIKELY((value && leadingZeros) || (previousValueWasZero && (length > 1 || immediatelyAfterCompress)))) 2455 2462 syntaxViolation(hostBegin); 2456 2463 … … 2461 2468 return WTF::nullopt; 2462 2469 advance(c, hostBegin); 2470 2471 immediatelyAfterCompress = false; 2463 2472 } 2464 2473 -
trunk/Tools/ChangeLog
r245982 r245983 1 2019-05-31 Alex Christensen <achristensen@webkit.org> 2 3 URLParser::parseIPv6Host should properly parse 0's around compression 4 https://bugs.webkit.org/show_bug.cgi?id=198424 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WTF/URLParser.cpp: 9 (TestWebKitAPI::TEST_F): 10 1 11 2019-05-31 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp
r245982 r245983 231 231 checkURL("about:blank?query", {"about", "", "", "", 0, "blank", "query", "", "about:blank?query"}); 232 232 checkURL("about:blank#fragment", {"about", "", "", "", 0, "blank", "", "fragment", "about:blank#fragment"}); 233 checkURL("http://[0::0]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 234 checkURL("http://[0::]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 235 checkURL("http://[::]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 236 checkURL("http://[::0]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 237 checkURL("http://[::0:0]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 238 checkURL("http://[f::0:0]/", {"http", "", "", "[f::]", 0, "/", "", "", "http://[f::]/"}); 239 checkURL("http://[f:0::f]/", {"http", "", "", "[f::f]", 0, "/", "", "", "http://[f::f]/"}); 240 checkURL("http://[::0:ff]/", {"http", "", "", "[::ff]", 0, "/", "", "", "http://[::ff]/"}); 241 checkURL("http://[::00:0:0:0]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 242 checkURL("http://[::0:00:0:0]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 243 checkURL("http://[::0:0.0.0.0]/", {"http", "", "", "[::]", 0, "/", "", "", "http://[::]/"}); 233 244 checkURL("http://[0:f::f:f:0:0]", {"http", "", "", "[0:f::f:f:0:0]", 0, "/", "", "", "http://[0:f::f:f:0:0]/"}); 234 245 checkURL("http://[0:f:0:0:f::]", {"http", "", "", "[0:f:0:0:f::]", 0, "/", "", "", "http://[0:f:0:0:f::]/"}); … … 1229 1240 shouldFail("asdf://space In\aHost"); 1230 1241 shouldFail("asdf://[0:0:0:0:a:b:c:d"); 1242 shouldFail("http://[::0:0.0.00000.0]/"); 1231 1243 } 1232 1244
Note:
See TracChangeset
for help on using the changeset viewer.