summaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_addr.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_addr.c
parent297c1149f6b8b0f9ade5f2bf12e148056ef77734 (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_addr.c')
-rw-r--r--crypto/bio/b_addr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index b8e1f96e07..d3b758fc7a 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/
+#include <assert.h>
#include <string.h>
#include "bio_lcl.h"
@@ -565,7 +566,8 @@ static int addrinfo_wrap(int family, int socktype,
unsigned short port,
BIO_ADDRINFO **bai)
{
- OPENSSL_assert(bai != NULL);
+ if (bai == NULL)
+ return 0;
*bai = OPENSSL_zalloc(sizeof(**bai));
if (*bai == NULL)
@@ -760,8 +762,11 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
he_fallback_address = INADDR_ANY;
break;
default:
- OPENSSL_assert(("We forgot to handle a lookup type!" == 0));
- break;
+ /* We forgot to handle a lookup type! */
+ assert("We forgot to handle a lookup type!" == NULL);
+ BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_INTERNAL_ERROR);
+ ret = 0;
+ goto err;
}
} else {
he = gethostbyname(host);