From: Matt Caswell Date: Fri, 29 Apr 2016 10:27:09 +0000 (+0100) Subject: Check for failed malloc in BIO_ADDR_new X-Git-Tag: OpenSSL_1_1_0-pre6~991 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=138388fe33707529683e1a41b0fe47d60313e7c1;p=oweals%2Fopenssl.git Check for failed malloc in BIO_ADDR_new BIO_ADDR_new() calls OPENSSL_zalloc() which can fail - but the return value is not checked. Reviewed-by: Rich Salz --- diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c index bfc745b769..86c6c7eca8 100644 --- a/crypto/bio/b_addr.c +++ b/crypto/bio/b_addr.c @@ -83,6 +83,9 @@ BIO_ADDR *BIO_ADDR_new(void) { BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret)); + if (ret == NULL) + return NULL; + ret->sa.sa_family = AF_UNSPEC; return ret; }