]> andersk Git - openssh.git/commitdiff
- (dtucker) [auth-pam.c] malloc+memset -> calloc. Patch from
authordtucker <dtucker>
Sun, 20 May 2007 05:20:08 +0000 (05:20 +0000)
committerdtucker <dtucker>
Sun, 20 May 2007 05:20:08 +0000 (05:20 +0000)
   ldv at altlinux.org.

ChangeLog
auth-pam.c

index 7ad33315d1324b58b096f612ce09895a68f842e2..2a8670ca26edff723ca480b43bb1f225da71e5d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,8 @@
    - jolan@cvs.openbsd.org 2007/05/17 23:53:41
      [sshconnect2.c]
      djm owes me a vb and a tism cd for breaking ssh compilation
+ - (dtucker) [auth-pam.c] malloc+memset -> calloc.  Patch from
+   ldv at altlinux.org.
 
 20070509
  - (tim) [configure.ac] Bug #1287: Add missing test for ucred.h.
index c08d4722912da474a5a6b8951310b168d9c161c1..bfd8f3270bb13ab2fbbd4fdc22fd948f5ba2da7c 100644 (file)
@@ -686,8 +686,7 @@ sshpam_init_ctx(Authctxt *authctxt)
                return (NULL);
        }
 
-       ctxt = xmalloc(sizeof *ctxt);
-       memset(ctxt, 0, sizeof(*ctxt));
+       ctxt = xcalloc(1, sizeof *ctxt);
 
        /* Start the authentication thread */
        if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, socks) == -1) {
@@ -1130,9 +1129,8 @@ sshpam_passwd_conv(int n, sshpam_const struct pam_message **msg,
        if (n <= 0 || n > PAM_MAX_NUM_MSG)
                return (PAM_CONV_ERR);
 
-       if ((reply = malloc(n * sizeof(*reply))) == NULL)
+       if ((reply = calloc(n, sizeof(*reply))) == NULL)
                return (PAM_CONV_ERR);
-       memset(reply, 0, n * sizeof(*reply));
 
        for (i = 0; i < n; ++i) {
                switch (PAM_MSG_MEMBER(msg, i, msg_style)) {
This page took 0.049989 seconds and 5 git commands to generate.