[openssh-commits] [openssh] 03/15: upstream: fix memleak of channel forwarding permissions; ok

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Sep 15 16:13: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.

commit fae8e41741d23298c94a1ea3ef8704a1cc186cb5
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Mon Sep 15 04:39:58 2025 +0000

    upstream: fix memleak of channel forwarding permissions; ok
    
    dtucker@
    
    OpenBSD-Commit-ID: 069745547109bc8fcc09fab5b19c53599cae99fd
---
 channels.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/channels.c b/channels.c
index 2a4cb0e31..aeb0d41d6 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.448 2025/08/18 03:43:01 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.449 2025/09/15 04:39:58 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -4588,10 +4588,13 @@ void
 channel_clear_permission(struct ssh *ssh, int who, int where)
 {
 	struct permission **permp;
-	u_int *npermp;
+	u_int i, *npermp;
 
 	permission_set_get_array(ssh, who, where, &permp, &npermp);
-	*permp = xrecallocarray(*permp, *npermp, 0, sizeof(**permp));
+	for (i = 0; i < *npermp; i++)
+		fwd_perm_clear((*permp) + i);
+	free(*permp);
+	*permp = NULL;
 	*npermp = 0;
 }
 

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


More information about the openssh-commits mailing list