diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-11-24 16:16:08 +0100 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-11-25 13:33:50 +0100 |
commit | 931d5b4b27fcc907e3ff4d4328c59a5f285a44fb (patch) | |
tree | 07772d16ffd4a861f47e51c9f985e8262f5e3439 /apps/cmp.c | |
parent | 68f9d9223b247f5c6e50bf66f405bc2fb09295cf (diff) |
apps/cmp.c: fix crash with -batch option on OPENSSL_NO_UI_CONSOLE
Also make clear we cannot use get_ui_method() at this point.
Fixes #13494
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13497)
Diffstat (limited to 'apps/cmp.c')
-rw-r--r-- | apps/cmp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index 68edfd88da..17173374df 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -2698,13 +2698,10 @@ int cmp_main(int argc, char **argv) ret = 0; if (opt_batch) { - UI_METHOD *ui_fallback_method; #ifndef OPENSSL_NO_UI_CONSOLE - ui_fallback_method = UI_OpenSSL(); -#else - ui_fallback_method = (UI_METHOD *)UI_null(); + UI_method_set_reader(UI_OpenSSL(), NULL); + /* can't change get_ui_method() here as load_key_certs_crls() uses it */ #endif - UI_method_set_reader(ui_fallback_method, NULL); } if (opt_engine != NULL) |