[openssh-commits] [openssh] branch master updated: upstream: replace xmalloc+memset(0) with xcalloc(); from AZero13 via

git+noreply at mindrot.org git+noreply at mindrot.org
Sat May 24 21:42:42 AEST 2025


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new 73ef0563a upstream: replace xmalloc+memset(0) with xcalloc(); from AZero13 via
73ef0563a is described below

commit 73ef0563a59f90324f8426c017f38e20341b555f
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Sat May 24 11:41:51 2025 +0000

    upstream: replace xmalloc+memset(0) with xcalloc(); from AZero13 via
    
    GHPR417
    
    OpenBSD-Commit-ID: 921079436a4900325d22bd3b6a90c8d0d54f62f8
---
 channels.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/channels.c b/channels.c
index 5d503025f..cd27faab2 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.443 2025/05/24 08:09:32 dtucker Exp $ */
+/* $OpenBSD: channels.c,v 1.444 2025/05/24 11:41:51 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -4677,8 +4677,7 @@ connect_to_helper(struct ssh *ssh, const char *name, int port, int socktype,
 		 * channel_connect_ctx_free() must check ai_family
 		 * and use free() not freeaddirinfo() for AF_UNIX.
 		 */
-		ai = xmalloc(sizeof(*ai) + sizeof(*sunaddr));
-		memset(ai, 0, sizeof(*ai) + sizeof(*sunaddr));
+		ai = xcalloc(1, sizeof(*ai) + sizeof(*sunaddr));
 		ai->ai_addr = (struct sockaddr *)(ai + 1);
 		ai->ai_addrlen = sizeof(*sunaddr);
 		ai->ai_family = AF_UNIX;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list