Stop init loops
authorRichard Levitte <levitte@openssl.org>
Mon, 14 Nov 2016 22:53:45 +0000 (23:53 +0100)
committerRichard Levitte <richard@levitte.org>
Tue, 15 Nov 2016 00:28:35 +0000 (01:28 +0100)
commitf56c786769e13bb06e9855cd426e74a1c9eea3a1
tree614dbc11632ce27c5eb83e33f3071fd14524e171
parentdd512a93902379364276588deb30ba03bf7f3b2d
Stop init loops

Under certain circumstances, the libcrypto init code would loop,
causing a deadlock.  This would typically happen if something in
ossl_init_base() caused an OpenSSL error, and the error stack routines
would recurse into the init code before the flag that ossl_init_base()
had been run was checked.

This change makes sure ossl_init_base isn't run once more of the base
is initiated.

Thanks to Dmitry Kostjuchenko for the idea.

Fixes Github issue #1899

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1922)
(cherry picked from commit b7a7f39afeb4748b4c25dbccb8951711b8b70eaf)
crypto/init.c