aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-02-13 19:29:34 +0100
committerRich Salz <rsalz@openssl.org>2016-04-28 14:37:41 -0400
commit25a807bcb9509c6fccfbbd9d02119772ccb0f23e (patch)
tree66ebeec7f6213a64318b8f26fd064860832bf0e1 /crypto/bio
parent8fdc99cb5dbf1a79b106cc635c82f59956e39108 (diff)
downloadopenssl-25a807bcb9509c6fccfbbd9d02119772ccb0f23e.tar.gz
Add checks on CRYPTO_new_ex_data return value
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/996)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio_lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 94c97da369..6ddc19fc9a 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -93,7 +93,8 @@ int BIO_set(BIO *bio, const BIO_METHOD *method)
bio->references = 1;
bio->num_read = 0L;
bio->num_write = 0L;
- CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
+ if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
+ return 0;
bio->lock = CRYPTO_THREAD_lock_new();
if (bio->lock == NULL) {