aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_addr.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2016-02-19 16:23:08 +0100
committerEmilia Kasper <emilia@openssl.org>2016-02-19 16:44:28 +0100
commitf0496ad71fbacccf5a95f40d31d251bc8cf9dcfb (patch)
tree4ee24f6b34c3024e1092161c3a413fc2b18aaea9 /crypto/bio/b_addr.c
parenteaa7e483c509d46f455a9deb148bfaf34a8fcbe3 (diff)
downloadopenssl-f0496ad71fbacccf5a95f40d31d251bc8cf9dcfb.tar.gz
getaddrinfo: zero the hints structure
This silences the memory sanitizer. All fields were already correctly initialized but the struct padding wasn't, causing an uninitialized read warning. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/bio/b_addr.c')
-rw-r--r--crypto/bio/b_addr.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index a46cf93786..6125e86124 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -681,18 +681,13 @@ int BIO_lookup(const char *host, const char *service,
int gai_ret = 0;
#ifdef AI_PASSIVE
struct addrinfo hints;
+ memset(&hints, 0, sizeof hints);
- hints.ai_flags = 0;
# ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
# endif
hints.ai_family = family;
hints.ai_socktype = socktype;
- hints.ai_protocol = 0;
- hints.ai_addrlen = 0;
- hints.ai_addr = NULL;
- hints.ai_canonname = NULL;
- hints.ai_next = NULL;
if (lookup_type == BIO_LOOKUP_SERVER)
hints.ai_flags |= AI_PASSIVE;