mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Don't clear errors on failure in CONF_modules_load_file_ex()
The call to CONF_modules_load() in CONF_modules_load_file_ex() can return a negative number to indicate failure. This was incorrectly being interpreted as "success" and therefore errors were being cleared incorrectly. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13311)
This commit is contained in:
parent
3309c4b716
commit
b8ae4a83de
@ -187,10 +187,11 @@ int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
|
||||
if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
|
||||
ret = 1;
|
||||
|
||||
if (ret)
|
||||
if (ret > 0)
|
||||
ERR_pop_to_mark();
|
||||
else
|
||||
ERR_clear_last_mark();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user