]> granicus.if.org Git - pdns/commit
Fix negative port detection for IPv6 addresses on 32-bit
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sun, 15 Jan 2017 20:45:27 +0000 (21:45 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 24 Jan 2017 13:29:12 +0000 (14:29 +0100)
commit3ada4e23acae40b0434e6118752a44519668f618
tree39bd45d3bab56ba4f6639758637733c21ff333a1
parent9388f1be79e49a1def301dad55512d50637b4982
Fix negative port detection for IPv6 addresses on 32-bit

On a 32-bit Arch, our `test_ComboAddress` unit test fails because
`ComboAddress("[::1]:-6")` is considered valid. This is caused by
`stoul()` not throwing for a negative value and returning an `unsigned
long` value using unsigned integer wraparound rules. Since we used to
store the result value in a `signed int` and treat negative values
as if the port was not set, the test failed.
pdns/misc.cc