summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-01-31 11:17:32 +0100
committerRichard Levitte <levitte@openssl.org>2018-01-31 17:45:11 +0100
commit7f55808fe723c146428415a470ed42331548007b (patch)
tree09927a636bff9e39f4917fa5ae693753eb1e5fa7
parent2e230e8687486b71c113915b864d6b1f6d465ed1 (diff)
BIO: at the end of BIO_new, declare the BIO inited if no create method present
Without this, every BIO implementation is forced to have a create method, just to set bio->init = 1. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5223)
-rw-r--r--crypto/bio/bio_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 8a2ec0ee69..dc4d0a0ca8 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -98,6 +98,8 @@ BIO *BIO_new(const BIO_METHOD *method)
CRYPTO_THREAD_lock_free(bio->lock);
goto err;
}
+ if (method->create == NULL)
+ bio->init = 1;
return bio;