diff options
author | Damien Miller <djm@mindrot.org> | 2006-03-26 14:19:21 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2006-03-26 14:19:21 +1100 |
commit | 07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938 (patch) | |
tree | 098295eee2d7ec7b116b0db3ac4b580713dd5ab0 /auth-bsdauth.c | |
parent | 7cd4579eb3c5afd22ae24436fd2611cd3aa0150a (diff) |
- djm@cvs.openbsd.org 2006/03/25 00:05:41
[auth-bsdauth.c auth-skey.c auth.c auth2-chall.c channels.c]
[clientloop.c deattack.c gss-genr.c kex.c key.c misc.c moduli.c]
[monitor.c monitor_wrap.c packet.c scard.c sftp-server.c ssh-agent.c]
[ssh-keyscan.c ssh.c sshconnect.c sshconnect2.c sshd.c uuencode.c]
[xmalloc.c xmalloc.h]
introduce xcalloc() and xasprintf() failure-checked allocations
functions and use them throughout openssh
xcalloc is particularly important because malloc(nmemb * size) is a
dangerous idiom (subject to integer overflow) and it is time for it
to die
feedback and ok deraadt@
Diffstat (limited to 'auth-bsdauth.c')
-rw-r--r-- | auth-bsdauth.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/auth-bsdauth.c b/auth-bsdauth.c index f48b43174..2ccbc9d43 100644 --- a/auth-bsdauth.c +++ b/auth-bsdauth.c | |||
@@ -68,9 +68,8 @@ bsdauth_query(void *ctx, char **name, char **infotxt, | |||
68 | *name = xstrdup(""); | 68 | *name = xstrdup(""); |
69 | *infotxt = xstrdup(""); | 69 | *infotxt = xstrdup(""); |
70 | *numprompts = 1; | 70 | *numprompts = 1; |
71 | *prompts = xmalloc(*numprompts * sizeof(char *)); | 71 | *prompts = xcalloc(*numprompts, sizeof(char *)); |
72 | *echo_on = xmalloc(*numprompts * sizeof(u_int)); | 72 | *echo_on = xcalloc(*numprompts, sizeof(u_int)); |
73 | (*echo_on)[0] = 0; | ||
74 | (*prompts)[0] = xstrdup(challenge); | 73 | (*prompts)[0] = xstrdup(challenge); |
75 | 74 | ||
76 | return 0; | 75 | return 0; |