From 6b051c4ebced22009916a826ac9d8f32842d7b3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lutz=20J=C3=A4nicke?= Date: Sun, 16 Nov 2003 16:31:22 +0000 Subject: [PATCH] Catch error condition to prevent NULL pointer dereference. Submitted by: Goetz Babin-Ebell PR: #766 --- apps/apps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/apps.c b/apps/apps.c index 007e3e06c3..1ab07af50b 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -501,7 +501,7 @@ static int ui_read(UI *ui, UI_STRING *uis) { const char *password = ((PW_CB_DATA *)UI_get0_user_data(ui))->password; - if (password[0] != '\0') + if (password && password[0] != '\0') { UI_set_result(ui, uis, password); return 1; @@ -525,7 +525,7 @@ static int ui_write(UI *ui, UI_STRING *uis) { const char *password = ((PW_CB_DATA *)UI_get0_user_data(ui))->password; - if (password[0] != '\0') + if (password && password[0] != '\0') return 1; } default: -- 2.50.1