Conversation
|
The reporter still needs to be acknowledged. Tests coming up. |
|
Tests: web-platform-tests/wpt#4513. |
|
This does not appear to give the correct results. Given input step 5: pointer = 2, piece pointer = compress pointer = 1 step 6 (main):
step 10:
|
|
Thanks @domenic for the detailed run through. I pushed something that should definitely fail for EOF after ".". (Was hard to wait until Monday for this one.) |
|
Now for invalid IPv4 addresses with more than 3 dots, parser does unnecessary loop and calculations until reaches EOF code point. I think additional check is required. I created two versions of fix here: https://github.com/rmisev/url/commits/ipv4-in-ipv6-v1 |
|
I think not failing early is fine. Or is there another test that we would fail with the proposed algorithm? I like your numbers seen variant though. It seems kinda nice to base it on that. |
|
I think the point of failure in your algorithm can be Integer overflow in step "4. Set piece to piece × 0x100 + value" (when invalid address has many dots). In some programming languages this can cause a run-time error. So I preffer numbers seen variant. |
|
That's a good point. @domenic mind reviewing this approach? Sorry about the churn. |
938bc10 to
ecc79fc
Compare
|
Thanks a lot for the patch @rmisev! |
Fixes #195.