UI_construct_prompt: check for NULL when allocating prompt
Signed-off-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
This commit is contained in:
parent
ba494ee593
commit
fb7fbf28b3
1 changed files with 2 additions and 0 deletions
|
@ -431,6 +431,8 @@ char *UI_construct_prompt(UI *ui, const char *object_desc,
|
|||
len += sizeof(prompt3) - 1;
|
||||
|
||||
prompt = (char *)OPENSSL_malloc(len + 1);
|
||||
if (prompt == NULL)
|
||||
return NULL;
|
||||
BUF_strlcpy(prompt, prompt1, len + 1);
|
||||
BUF_strlcat(prompt, object_desc, len + 1);
|
||||
if (object_name)
|
||||
|
|
Loading…
Reference in a new issue