]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Avoid overflow when computing latency
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 28 Feb 2020 12:46:03 +0000 (13:46 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 28 Feb 2020 13:25:39 +0000 (14:25 +0100)
commitb7d61cb18a9bc99d2c759f24e1340efc7a1c7725
tree6615f1669b28851394dc507873e44805e932269c
parenta818163a4c613dcb149791d6a9bed2c572535490
rec: Avoid overflow when computing latency

Reported by UBSan:

[2020-02-28 12:21:21] pdns_recursor.cc:1841:31: runtime error: -276679 is outside the range of representable values of type 'unsigned long'
[2020-02-28 12:21:21]     #0 0x5610bb76af48 in startDoResolve(void*) /home/travis/build/rgacogne/pdns/pdns/recursordist/pdns-recursor-0.0.0.0.HEAD.g5d6e6b9f95.dirty/pdns_recursor.cc:1841:31
[2020-02-28 12:21:21]     #1 0x5610bb7d60ac in MTasker<PacketID, std::string>::makeThread(void (*)(void*), void*)::{lambda()#1}::operator()() const /home/travis/build/rgacogne/pdns/pdns/recursordist/pdns-recursor-0.0.0.0.HEAD.g5d6e6b9f95.dirty/./mtasker.cc:284:7
[2020-02-28 12:21:21]     #2 0x5610bb6bae9d in boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:766:14
[2020-02-28 12:21:21]     #3 0x5610bb6ba21b in threadWrapper(long) /home/travis/build/rgacogne/pdns/pdns/recursordist/pdns-recursor-0.0.0.0.HEAD.g5d6e6b9f95.dirty/./mtasker_fcontext.cc:144:9
[2020-02-28 12:21:21]     #4 0x7f29cb06d70d in make_fcontext (/usr/lib/x86_64-linux-gnu/libboost_context.so.1.54.0+0x70d)
pdns/pdns_recursor.cc