diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-11-24 15:59:26 +1100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-11-24 17:29:38 +1100 |
commit | 2ad3eb3e8e87d3ae190f894a39c324b8d6da59bb (patch) | |
tree | f74c6b5f8683d831eb3d7f83c8953f938b193ba9 | |
parent | 0005c77afa8cbc084ebc60561a03e97a7bcf8e6e (diff) | |
download | libgit2-2ad3eb3e8e87d3ae190f894a39c324b8d6da59bb.tar.gz |
valgrind: add suppressions for undefined use
valgrind will warn that OpenSSL will use undefined data in connect/read
when talking to certain other TLS stacks. Thankfully, this only seems
to occur when gcc is the compiler, so hopefully valgrind is just
misunderstanding an optimization. Regardless, suppress this warning.
-rw-r--r-- | script/valgrind.supp | 20 | ||||
-rw-r--r-- | src/streams/openssl.c | 4 |
2 files changed, 24 insertions, 0 deletions
diff --git a/script/valgrind.supp b/script/valgrind.supp index 8459a71ad..d938aa9c9 100644 --- a/script/valgrind.supp +++ b/script/valgrind.supp @@ -124,6 +124,26 @@ } { + ignore-openssl-undefined-in-read + Memcheck:Cond + ... + obj:*libssl.so* + ... + fun:openssl_read + ... +} + +{ + ignore-openssl-undefined-in-connect + Memcheck:Cond + ... + obj:*libssl.so* + ... + fun:openssl_connect + ... +} + +{ ignore-libssh2-rsa-sha1-sign Memcheck:Leak ... diff --git a/src/streams/openssl.c b/src/streams/openssl.c index fe5f79cce..8613f70be 100644 --- a/src/streams/openssl.c +++ b/src/streams/openssl.c @@ -597,6 +597,10 @@ static int openssl_connect(git_stream *stream) st->connected = true; +#ifdef VALGRIND + VALGRIND_MAKE_MEM_DEFINED(st->ssl, sizeof(SSL)); +#endif + return verify_server_cert(st->ssl, st->host); } |