Commit 9a1a5b87 authored by Nils Larsch's avatar Nils Larsch
Browse files

avoid infinite recursion if dynamic engine isn't loaded

Submitted by: Jonathon Green <jonathon_au@yahoo.com>
parent f3b656b2
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -394,6 +394,9 @@ ENGINE *ENGINE_by_id(const char *id)
#else
	/* EEK! Experimental code starts */
	if(iterator) return iterator;
	/* Prevent infinite recusrion if we're looking for the dynamic engine. */
	if (strcmp(id, "dynamic"))
		{
#ifdef OPENSSL_SYS_VMS
		if((load_dir = getenv("OPENSSL_ENGINES")) == 0) load_dir = "SSLROOT:[ENGINES]";
#else
@@ -407,6 +410,7 @@ ENGINE *ENGINE_by_id(const char *id)
				!ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0))
				goto notfound;
		return iterator;
		}
notfound:
	ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE);
	ERR_add_error_data(2, "id=", id);