From: Dr. Stephen Henson Date: Thu, 28 Jan 2010 17:53:11 +0000 (+0000) Subject: In engine_table_select() don't clear out entire error queue: just clear X-Git-Tag: OpenSSL_0_9_8m~25 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0369804ffa977b8c0adae3e7c486db66a30ca62e;p=oweals%2Fopenssl.git In engine_table_select() don't clear out entire error queue: just clear out any we added using ERR_set_mark() and ERR_pop_to_mark() otherwise errors from other sources (e.g. SSL library) can be wiped. --- diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c index 8879a267d1..8fc47b3399 100644 --- a/crypto/engine/eng_table.c +++ b/crypto/engine/eng_table.c @@ -237,6 +237,7 @@ ENGINE *engine_table_select_tmp(ENGINE_TABLE **table, int nid, const char *f, in #endif return NULL; } + ERR_set_mark(); CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); /* Check again inside the lock otherwise we could race against cleanup * operations. But don't worry about a fprintf(stderr). */ @@ -310,6 +311,6 @@ end: CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); /* Whatever happened, any failed init()s are not failures in this * context, so clear our error state. */ - ERR_clear_error(); + ERR_pop_to_mark(); return ret; }