From: Richard Levitte Date: Wed, 31 Jan 2018 10:17:32 +0000 (+0100) Subject: BIO: at the end of BIO_new, declare the BIO inited if no create method present X-Git-Tag: OpenSSL_1_1_0h~93 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cd1caea433d44e63af517a8149eee6ed9f45f681;p=oweals%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/5223) (cherry picked from commit 7f55808fe723c146428415a470ed42331548007b) --- diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index 94888394c1..9210a216a5 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -42,6 +42,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;