]> andersk Git - openssh.git/blobdiff - monitor_wrap.c
- djm@cvs.openbsd.org 2006/03/25 00:05:41
[openssh.git] / monitor_wrap.c
index e5a65491d0e490d378cad968705ae1db6d1e5282..cd340360a0eb114b36635eae9cff2af39e8d883d 100644 (file)
@@ -859,8 +859,8 @@ mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
        *name = xstrdup("");
        *infotxt = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char *));
-       *echo_on = xmalloc(*numprompts * sizeof(u_int));
+       *prompts = xcalloc(*numprompts, sizeof(char *));
+       *echo_on = xcalloc(*numprompts, sizeof(u_int));
        (*echo_on)[0] = 0;
 }
 
@@ -953,11 +953,7 @@ mm_skey_query(void *ctx, char **name, char **infotxt,
 
        mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);
 
-       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);
        xfree(challenge);
 
        return (0);
This page took 0.082341 seconds and 4 git commands to generate.