summaryrefslogtreecommitdiff
path: root/auth-skey.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-skey.c')
-rw-r--r--auth-skey.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/auth-skey.c b/auth-skey.c
index ce8c1a80..3e6a06db 100644
--- a/auth-skey.c
+++ b/auth-skey.c
@@ -53,15 +53,10 @@ skey_query(void *ctx, char **name, char **infotxt,
*name = xstrdup("");
*infotxt = xstrdup("");
*numprompts = 1;
- *prompts = xmalloc(*numprompts * sizeof(char *));
- *echo_on = xmalloc(*numprompts * sizeof(u_int));
- (*echo_on)[0] = 0;
+ *prompts = xcalloc(*numprompts, sizeof(char *));
+ *echo_on = xcalloc(*numprompts, sizeof(u_int));
- len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;
- p = xmalloc(len);
- strlcpy(p, challenge, len);
- strlcat(p, SKEY_PROMPT, len);
- (*prompts)[0] = p;
+ xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT);
return 0;
}