]> git.ipfire.org Git - thirdparty/pdns.git/commit
Fix negative port detection for IPv6 addresses on 32-bit 4936/head
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:28:41 +0000 (14:28 +0100)
commit59bee6a747c415d5b0f72b4c658acdeda2b34ace
treee28d0f93cbbe8c1dcfcccbecb4137f63488e7aba
parent4b792e15fd3c588ce66467913516ff295f375418
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