]> git.ipfire.org Git - thirdparty/pdns.git/commit
Fix negative port detection for IPv6 addresses on 32-bit 4911/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sun, 15 Jan 2017 20:45:27 +0000 (21:45 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Sun, 15 Jan 2017 20:45:27 +0000 (21:45 +0100)
commit6cbfa73b35a5cc7325b58625c0698576fb99601f
treeeccc33f14faff5e85c295d13947536f3a5e32c98
parenteea741af533044e986da2aa62eca0d69356289f8
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