From 9de450b545e5cb493ded247099a93bfda1108f1b Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 12 Mar 2010 12:48:56 +0000 Subject: [PATCH] PR: 2192 Submitted By: Jaroslav Imrich The prompt_info and wrong_info parameters can be empty strings which can produce confusing prompts. Treat empty string same as NULL. --- engines/e_chil.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engines/e_chil.c b/engines/e_chil.c index e1847622ea..3a07076b4f 100644 --- a/engines/e_chil.c +++ b/engines/e_chil.c @@ -1204,6 +1204,11 @@ static int hwcrhk_get_pass(const char *prompt_info, pem_password_cb *callback = NULL; void *callback_data = NULL; UI_METHOD *ui_method = NULL; + /* Despite what the documentation says prompt_info can be + * an empty string. + */ + if (prompt_info && !*prompt_info) + prompt_info = NULL; if (cactx) { @@ -1305,8 +1310,10 @@ static int hwcrhk_insert_card(const char *prompt_info, { char answer; char buf[BUFSIZ]; - - if (wrong_info) + /* Despite what the documentation says wrong_info can be + * an empty string. + */ + if (wrong_info && *wrong_info) BIO_snprintf(buf, sizeof(buf)-1, "Current card: \"%s\"\n", wrong_info); ok = UI_dup_info_string(ui, buf); -- 2.40.0