diff options
author | Matt Caswell <matt@openssl.org> | 2017-04-24 11:45:42 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-04-25 11:13:39 +0100 |
commit | c90da922ddaa3b470f4c1c11d02f370589a31912 (patch) | |
tree | af4036fa878c2f53a5f950031c23ed9da1ce48b1 | |
parent | 0f5df0f1037590de12cc11eeab26fe29bf3f16a3 (diff) |
Fix some variable references in init_client
We were incorrectly using "res" when we meant "ai"
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3286)
-rw-r--r-- | apps/s_socket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c index 04f3e6741c..1c5c13742c 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -77,13 +77,14 @@ int init_client(int *sock, const char *host, const char *port, /* Admittedly, these checks are quite paranoid, we should not get * anything in the BIO_ADDRINFO chain that we haven't * asked for. */ - OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res)) - && (type == 0 || type == BIO_ADDRINFO_socktype(res)) + OPENSSL_assert((family == AF_UNSPEC + || family == BIO_ADDRINFO_family(ai)) + && (type == 0 || type == BIO_ADDRINFO_socktype(ai)) && (protocol == 0 - || protocol == BIO_ADDRINFO_protocol(res))); + || protocol == BIO_ADDRINFO_protocol(ai))); *sock = BIO_socket(BIO_ADDRINFO_family(ai), BIO_ADDRINFO_socktype(ai), - BIO_ADDRINFO_protocol(res), 0); + BIO_ADDRINFO_protocol(ai), 0); if (*sock == INVALID_SOCKET) { /* Maybe the kernel doesn't support the socket family, even if * BIO_lookup() added it in the returned result... |