From: Lutz Jänicke Date: Sun, 16 Nov 2003 16:30:39 +0000 (+0000) Subject: Catch error condition to prevent NULL pointer dereference. X-Git-Tag: BEN_FIPS_TEST_4^2~11^2~19 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=f35232e6f3dee19e8d54a9247d2af39144cb0da1 Catch error condition to prevent NULL pointer dereference. Submitted by: Goetz Babin-Ebell PR: #766 --- diff --git a/apps/apps.c b/apps/apps.c index b1916bbc0f..62fa21d5d0 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -475,7 +475,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; @@ -499,7 +499,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: