diff --git a/.regression.yml b/.regression.yml index d86d6552a..8810bef53 100644 --- a/.regression.yml +++ b/.regression.yml @@ -14,7 +14,7 @@ clean: time_limit: 180 features: - - variant=release asserts=production invariant-checks=off debug-iterators=off + - variant=release asserts=production invariant-checks=off debug-iterators=off debug-symbols=on - encryption=openssl statistics=on logging=verbose disk-stats=on dht=logging request-log=on - ipv6=off dht=off extensions=off logging=none deprecated-functions=off diff --git a/src/kademlia/node.cpp b/src/kademlia/node.cpp index fc37e302b..2912f2dbe 100644 --- a/src/kademlia/node.cpp +++ b/src/kademlia/node.cpp @@ -55,6 +55,10 @@ POSSIBILITY OF SUCH DAMAGE. #include "ed25519.h" +#ifdef TORRENT_USE_VALGRIND +#include +#endif + namespace libtorrent { namespace dht { @@ -962,7 +966,14 @@ void node_impl::incoming_request(msg const& m, entry& e) std::pair buf = msg_keys[1]->data_section(); memcpy(seq + len, buf.first, buf.second); len += buf.second; + TORRENT_ASSERT(len <= 1020); +#ifdef TORRENT_USE_VALGRIND + VALGRIND_CHECK_MEM_IS_DEFINED(buf.first, buf.second); + VALGRIND_CHECK_MEM_IS_DEFINED(msg_keys[4]->string_ptr(), 64); + VALGRIND_CHECK_MEM_IS_DEFINED(msg_keys[3]->string_ptr(), 32); + VALGRIND_CHECK_MEM_IS_DEFINED(seq, len); +#endif // msg_keys[4] is the signature, msg_keys[3] is the public key if (ed25519_verify((unsigned char const*)msg_keys[4]->string_ptr() , (unsigned char const*)seq, len