diff options
author | Damien Miller <djm@mindrot.org> | 2006-03-26 05:19:21 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2006-03-26 05:19:21 +0200 |
commit | 07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938 (patch) | |
tree | 098295eee2d7ec7b116b0db3ac4b580713dd5ab0 /auth-bsdauth.c | |
parent | - djm@cvs.openbsd.org 2006/03/22 21:27:15 (diff) | |
download | openssh-07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938.tar.xz openssh-07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938.zip |
- 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, *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)); (*prompts)[0] = xstrdup(challenge); return 0; |