mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
Catch error condition to prevent NULL pointer dereference.
Submitted by: Goetz Babin-Ebell <babin-ebell@trustcenter.de> PR: #766
This commit is contained in:
parent
fda5e38551
commit
f35232e6f3
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user