summaryrefslogtreecommitdiffstats
path: root/apps/lib
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-04 10:11:02 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-09-10 22:01:07 +0200
commitf84de16f397b06831ea5569a285518c035285f46 (patch)
treec734bd3e6313db5ba79deb89ec537ff276c9f3f5 /apps/lib
parent9a62ccbe8a73101d2cfcdf7902b6fe10da7602c9 (diff)
apps_ui.c: Improve error handling and return value of setup_ui_method()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12493)
Diffstat (limited to 'apps/lib')
-rw-r--r--apps/lib/apps_ui.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/lib/apps_ui.c b/apps/lib/apps_ui.c
index 13f8670d9f..8523cda3c2 100644
--- a/apps/lib/apps_ui.c
+++ b/apps/lib/apps_ui.c
@@ -106,11 +106,13 @@ int setup_ui_method(void)
ui_fallback_method = UI_OpenSSL();
#endif
ui_method = UI_create_method("OpenSSL application user interface");
- UI_method_set_opener(ui_method, ui_open);
- UI_method_set_reader(ui_method, ui_read);
- UI_method_set_writer(ui_method, ui_write);
- UI_method_set_closer(ui_method, ui_close);
- return 0;
+ return ui_method != NULL
+ && 0 == UI_method_set_opener(ui_method, ui_open)
+ && 0 == UI_method_set_reader(ui_method, ui_read)
+ && 0 == UI_method_set_writer(ui_method, ui_write)
+ && 0 == UI_method_set_closer(ui_method, ui_close)
+ && 0 == UI_method_set_prompt_constructor(ui_method,
+ ui_prompt_construct);
}
void destroy_ui_method(void)