[openssh-commits] [openssh] 01/02: upstream: Make sure sftp_get_limits() only returns 0 if 'limits'

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Nov 16 09:53:58 AEDT 2023


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

djm pushed a commit to branch master
in repository openssh.

commit 676377ce67807a24e08a54cd60ec832946cc6cae
Author: tobhe at openbsd.org <tobhe at openbsd.org>
Date:   Mon Nov 13 09:18:19 2023 +0000

    upstream: Make sure sftp_get_limits() only returns 0 if 'limits'
    
    was initialized. This fixes a potential uninitialized use of 'limits' in
    sftp_init() if sftp_get_limits() returned early because of an unexpected
    message type.
    
    ok djm@
    
    OpenBSD-Commit-ID: 1c177d7c3becc1d71bc8763eecf61873a1d3884c
---
 sftp-client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sftp-client.c b/sftp-client.c
index 2598029f..5cc8bb53 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.174 2023/09/08 06:10:02 djm Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.175 2023/11/13 09:18:19 tobhe Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm at openbsd.org>
  *
@@ -656,7 +656,7 @@ sftp_get_limits(struct sftp_conn *conn, struct sftp_limits *limits)
 		/* Disable the limits extension */
 		conn->exts &= ~SFTP_EXT_LIMITS;
 		sshbuf_free(msg);
-		return 0;
+		return -1;
 	}
 
 	memset(limits, 0, sizeof(*limits));

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


More information about the openssh-commits mailing list