aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-06-21 15:52:11 +0100
committerMatt Caswell <matt@openssl.org>2017-08-21 08:44:44 +0100
commit86f31dd9cc81d1c2429846ab663ecd8a29333e3b (patch)
treec5bd93769d3fc43dc4c2fd170ef04bd2f8c93b04 /crypto/bio/b_sock.c
parent297c1149f6b8b0f9ade5f2bf12e148056ef77734 (diff)
downloadopenssl-86f31dd9cc81d1c2429846ab663ecd8a29333e3b.tar.gz
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.c15
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 {