diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-08 10:23:54 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-10 10:57:16 +0100 |
commit | 457856f27a282a9f7ebb3a72eaedc81268f4c5bb (patch) | |
tree | 9c289837f2f6249b0c70e6bde297a7fb9faeaee2 /crypto/ui/ui_lib.c | |
parent | Fix REF_PRINT_COUNT argument in ecx_key_free (diff) | |
download | openssl-457856f27a282a9f7ebb3a72eaedc81268f4c5bb.tar.xz openssl-457856f27a282a9f7ebb3a72eaedc81268f4c5bb.zip |
UI: Use OPENSSL_zalloc() in general_allocate_prompt()
This is to ensure that fields we don't set explicitly are always zero.
Fixes #13340
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13346)
Diffstat (limited to '')
-rw-r--r-- | crypto/ui/ui_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 017afb7c07..af6461fb15 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -106,7 +106,7 @@ static UI_STRING *general_allocate_prompt(UI *ui, const char *prompt, } else if ((type == UIT_PROMPT || type == UIT_VERIFY || type == UIT_BOOLEAN) && result_buf == NULL) { UIerr(UI_F_GENERAL_ALLOCATE_PROMPT, UI_R_NO_RESULT_BUFFER); - } else if ((ret = OPENSSL_malloc(sizeof(*ret))) != NULL) { + } else if ((ret = OPENSSL_zalloc(sizeof(*ret))) != NULL) { ret->out_string = prompt; ret->flags = prompt_freeable ? OUT_STRING_FREEABLE : 0; ret->input_flags = input_flags; |