From 6a66c051798332fbbf0fbffe09ff914746ece41f Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 16 Feb 2016 13:27:09 +0000 Subject: [PATCH 1/2] Problem: curve keys getsockopt uninitialised read Solution: always initialised zmq::options_t class variables arrays to avoid reading uninitialised data when CURVE is not yet configured and a getsockopt ZMQ_CURVE_{SERVER | PUBLIC | SECRET]KEY is issued. Backport from libzmq. --- src/options.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/options.cpp b/src/options.cpp index ea4f74c94..577763bbd 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -68,6 +68,9 @@ zmq::options_t::options_t () : conflate (false), handshake_ivl (30000) { + memset (curve_public_key, 0, CURVE_KEYSIZE); + memset (curve_secret_key, 0, CURVE_KEYSIZE); + memset (curve_server_key, 0, CURVE_KEYSIZE); } int zmq::options_t::setsockopt (int option_, const void *optval_, From eda5426865a6035d564f1a1f8af67c64b38a8f6e Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 16 Feb 2016 13:41:46 +0000 Subject: [PATCH 2/2] Problem: Travis CI uses libsodium unstable branch Solution: use stable branch instead of the development branch, and also clone with --depth 1 to make it more efficient. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 24642dbfd..e01f9d78f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ env: before_script: - mkdir tmp # libsodium -- git clone git://github.com/jedisct1/libsodium.git +- git clone --depth 1 -b stable git://github.com/jedisct1/libsodium.git - ( cd libsodium; ./autogen.sh; ./configure --prefix=${BUILD_PREFIX}; make check; make install ) # ZMQ stress tests need more open socket (files) than the usual default