summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ui')
-rw-r--r--crypto/ui/ui_err.c3
-rw-r--r--crypto/ui/ui_lib.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/crypto/ui/ui_err.c b/crypto/ui/ui_err.c
index e69163c470..b806872c30 100644
--- a/crypto/ui/ui_err.c
+++ b/crypto/ui/ui_err.c
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -22,6 +22,7 @@ static const ERR_STRING_DATA UI_str_functs[] = {
"general_allocate_prompt"},
{ERR_PACK(ERR_LIB_UI, UI_F_NOECHO_CONSOLE, 0), "noecho_console"},
{ERR_PACK(ERR_LIB_UI, UI_F_OPEN_CONSOLE, 0), "open_console"},
+ {ERR_PACK(ERR_LIB_UI, UI_F_UI_CONSTRUCT_PROMPT, 0), "UI_construct_prompt"},
{ERR_PACK(ERR_LIB_UI, UI_F_UI_CREATE_METHOD, 0), "UI_create_method"},
{ERR_PACK(ERR_LIB_UI, UI_F_UI_CTRL, 0), "UI_ctrl"},
{ERR_PACK(ERR_LIB_UI, UI_F_UI_DUP_ERROR_STRING, 0), "UI_dup_error_string"},
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index 98519877f4..533dc076ae 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -374,9 +374,10 @@ char *UI_construct_prompt(UI *ui, const char *object_desc,
len += sizeof(prompt2) - 1 + strlen(object_name);
len += sizeof(prompt3) - 1;
- prompt = OPENSSL_malloc(len + 1);
- if (prompt == NULL)
+ if ((prompt = OPENSSL_malloc(len + 1)) == NULL) {
+ UIerr(UI_F_UI_CONSTRUCT_PROMPT, ERR_R_MALLOC_FAILURE);
return NULL;
+ }
OPENSSL_strlcpy(prompt, prompt1, len + 1);
OPENSSL_strlcat(prompt, object_desc, len + 1);
if (object_name != NULL) {