diff options
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r-- | monitor_wrap.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index e5a65491d..cd340360a 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c | |||
@@ -859,8 +859,8 @@ mm_chall_setup(char **name, char **infotxt, u_int *numprompts, | |||
859 | *name = xstrdup(""); | 859 | *name = xstrdup(""); |
860 | *infotxt = xstrdup(""); | 860 | *infotxt = xstrdup(""); |
861 | *numprompts = 1; | 861 | *numprompts = 1; |
862 | *prompts = xmalloc(*numprompts * sizeof(char *)); | 862 | *prompts = xcalloc(*numprompts, sizeof(char *)); |
863 | *echo_on = xmalloc(*numprompts * sizeof(u_int)); | 863 | *echo_on = xcalloc(*numprompts, sizeof(u_int)); |
864 | (*echo_on)[0] = 0; | 864 | (*echo_on)[0] = 0; |
865 | } | 865 | } |
866 | 866 | ||
@@ -953,11 +953,7 @@ mm_skey_query(void *ctx, char **name, char **infotxt, | |||
953 | 953 | ||
954 | mm_chall_setup(name, infotxt, numprompts, prompts, echo_on); | 954 | mm_chall_setup(name, infotxt, numprompts, prompts, echo_on); |
955 | 955 | ||
956 | len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; | 956 | xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT); |
957 | p = xmalloc(len); | ||
958 | strlcpy(p, challenge, len); | ||
959 | strlcat(p, SKEY_PROMPT, len); | ||
960 | (*prompts)[0] = p; | ||
961 | xfree(challenge); | 957 | xfree(challenge); |
962 | 958 | ||
963 | return (0); | 959 | return (0); |