From f91b753a742766a3e0ea1d02aa44ffb695f06c53 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 19 Sep 2003 12:13:53 +0000 Subject: [PATCH] Check for NULL value from silc_get_input. --- lib/silcutil/silcapputil.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/silcutil/silcapputil.c b/lib/silcutil/silcapputil.c index 723ca37f..1f486afa 100644 --- a/lib/silcutil/silcapputil.c +++ b/lib/silcutil/silcapputil.c @@ -183,6 +183,8 @@ New pair of keys will be created. Please, answer to following questions.\n\ while (TRUE) { printf("\n"); pass2 = silc_get_input("Retype private key passphrase: ", TRUE); + if (!pass2) + pass2 = strdup(""); if (!strcmp(pass, pass2)) break; fprintf(stderr, "\nPassphrases do not match"); @@ -401,6 +403,8 @@ bool silc_change_private_key_passphrase(const char *prv_filename, while (TRUE) { printf("\n"); pass2 = silc_get_input("Retype new passphrase: ", TRUE); + if (!pass2) + pass2 = strdup(""); if (!strcmp(pass, pass2)) break; fprintf(stderr, "\nPassphrases do not match"); -- 2.43.0