diff options
author | Matt Caswell <matt@openssl.org> | 2016-04-29 12:27:09 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-04-29 17:47:41 +0200 |
commit | 138388fe33707529683e1a41b0fe47d60313e7c1 (patch) | |
tree | 031978cdfd03482687695771df6086ccfb95ded1 /crypto/bio | |
parent | The x509_name_canon function doesn't check for an error return (diff) | |
download | openssl-138388fe33707529683e1a41b0fe47d60313e7c1.tar.xz openssl-138388fe33707529683e1a41b0fe47d60313e7c1.zip |
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 <rsalz@openssl.org>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_addr.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |