Commit 2aa3800
committed
gh-156680: Raise the documented error from IPv6Network.next_network()
next_network() guarded address-space exhaustion with except
OverflowError, which only int.to_bytes() on the IPv4 path raises.
_BaseV6._string_from_ip_int() raises ValueError instead, so the
handler never ran for IPv6 and the internal 'IPv6 address is too
large' message escaped.
Range-check next_ip against _ALL_ONES before formatting it, which
decides the outcome for both address families before either path
runs.1 parent 852381e commit 2aa3800
2 files changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1150 | 1150 | | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
| 1153 | + | |
1158 | 1154 | | |
1159 | 1155 | | |
1160 | 1156 | | |
1161 | | - | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | | - | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1600 | 1603 | | |
1601 | | - | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1602 | 1608 | | |
1603 | 1609 | | |
1604 | 1610 | | |
| |||
0 commit comments