diff options
author | Matt Caswell <matt@openssl.org> | 2017-06-21 15:52:11 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-08-21 08:44:44 +0100 |
commit | 86f31dd9cc81d1c2429846ab663ecd8a29333e3b (patch) | |
tree | c5bd93769d3fc43dc4c2fd170ef04bd2f8c93b04 /crypto/bio/b_sock.c | |
parent | 297c1149f6b8b0f9ade5f2bf12e148056ef77734 (diff) |
Remove OPENSSL_assert() from various crypto/bio files
bss_dgram.c is deferred until later due to ongoing discussions.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3740)
Diffstat (limited to 'crypto/bio/b_sock.c')
-rw-r--r-- | crypto/bio/b_sock.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 97dcc7005e..65339629f8 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -43,14 +43,13 @@ int BIO_get_host_ip(const char *str, unsigned char *ip) if (BIO_ADDRINFO_family(res) != AF_INET) { BIOerr(BIO_F_BIO_GET_HOST_IP, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET); - } else { - BIO_ADDR_rawaddress(BIO_ADDRINFO_address(res), NULL, &l); - /* Because only AF_INET addresses will reach this far, - we can assert that l should be 4 */ - OPENSSL_assert(l == 4); - - BIO_ADDR_rawaddress(BIO_ADDRINFO_address(res), ip, &l); - ret = 1; + } else if (BIO_ADDR_rawaddress(BIO_ADDRINFO_address(res), NULL, &l)) { + /* + * Because only AF_INET addresses will reach this far, we can assert + * that l should be 4 + */ + if (ossl_assert(l == 4)) + ret = BIO_ADDR_rawaddress(BIO_ADDRINFO_address(res), ip, &l); } BIO_ADDRINFO_free(res); } else { |