Skip to content

Commit 5d84ffb

Browse files
lrhnCommit Queue
authored andcommitted
BREAKING CHANGE: Fix parseIPv4Address to not allow leading zeros.
Rewrite `parseIPv4Address` and `parseIPv6Address` to not do so much unnecessary allocation and copying. This is a breaking change if someone, somewhere, depends on parsing IPv4 addresses with leading zeros. Neither RFC 3986 or the WhatWG URL spec allows leading zeros, so it wouldn't work anywhere else. Because of that, it's not expected to be breaking in practice. Fixes #61392. BUG= https://dartbug.com/61392 Change-Id: I045353d5d1606795048e12ee12cd12b30dbf8ab3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447260 Commit-Queue: Lasse Nielsen <[email protected]> Reviewed-by: Ömer Ağacan <[email protected]> Reviewed-by: Slava Egorov <[email protected]> Reviewed-by: Stephen Adams <[email protected]>
1 parent c1f4e21 commit 5d84ffb

File tree

4 files changed

+581
-182
lines changed

4 files changed

+581
-182
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ instead.
9090

9191
### Libraries
9292

93+
#### `dart:core`
94+
95+
- **Breaking Change** [#61392][]: The `Uri.parseIPv4Address` function
96+
no longer incorrectly allows leading zeros. This also applies to
97+
`Uri.parseIPv6Address` for IPv4 addresses embedded in IPv6 addresses.
98+
- The `Uri.parseIPv4Address` adds `start` and `end` parameters
99+
to allow parsing a substring without creating a new string.
100+
101+
[#61392]: https://dartbug.com/61392
102+
93103
#### `dart:io`
94104

95105
- **Breaking Change** [#56468][]: Marked `IOOverrides` as an `abstract base`

0 commit comments

Comments
 (0)