summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ui
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2003-03-16 12:18:22 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2003-03-16 12:18:22 +0000
commit10c2af0f805dc9e1f182012e128c07357767ecaf (patch)
treebb0da98a7b4eb46135d50298b6d6d3a99d7a7f56 /lib/libcrypto/ui
parentb39414e39b731f07eb5a3af8bc94d066713e9001 (diff)
Less strcpy/strcat/sprintf. tdeval@ ok.
Diffstat (limited to 'lib/libcrypto/ui')
-rw-r--r--lib/libcrypto/ui/ui_lib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c
index 16946cad95b..cce9075ac1d 100644
--- a/lib/libcrypto/ui/ui_lib.c
+++ b/lib/libcrypto/ui/ui_lib.c
@@ -428,14 +428,14 @@ char *UI_construct_prompt(UI *ui, const char *object_desc,
len += sizeof(prompt3) - 1;
prompt = (char *)OPENSSL_malloc(len + 1);
- strcpy(prompt, prompt1);
- strcat(prompt, object_desc);
+ strlcpy(prompt, prompt1, len + 1);
+ strlcat(prompt, object_desc, len + 1);
if (object_name)
{
- strcat(prompt, prompt2);
- strcat(prompt, object_name);
+ strlcat(prompt, prompt2, len + 1);
+ strlcat(prompt, object_name, len + 1);
}
- strcat(prompt, prompt3);
+ strlcat(prompt, prompt3, len + 1);
}
return prompt;
}
@@ -863,7 +863,8 @@ int UI_set_result(UI *ui, UI_STRING *uis, const char *result)
return -1;
}
- strcpy(uis->result_buf, result);
+ strlcpy(uis->result_buf, result,
+ uis->_.string_data.result_maxsize + 1);
break;
case UIT_BOOLEAN:
{