[openssh-commits] [openssh] 02/02: upstream: ensure c->local_window doesn't underflow during updates;

git+noreply at mindrot.org git+noreply at mindrot.org
Sat Mar 28 16:19:12 AEDT 2026


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

djm pushed a commit to branch master
in repository openssh.

commit fd5018fbeb6e91ae4321490c2825ecc632b83748
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Sat Mar 28 05:16:18 2026 +0000

    upstream: ensure c->local_window doesn't underflow during updates;
    
    similar to checks performed elsewhere. From Renaud Allard
    
    OpenBSD-Commit-ID: 4827c10807936e9ab9af2cf1c7379e1f56dbdeac
---
 channels.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/channels.c b/channels.c
index e36c3bbf8..d7c55fc89 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.457 2026/03/05 05:40:35 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.458 2026/03/28 05:16:18 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -3507,7 +3507,10 @@ channel_input_data(int type, uint32_t seq, struct ssh *ssh)
 	 * updates are sent back. Otherwise the connection might deadlock.
 	 */
 	if (c->ostate != CHAN_OUTPUT_OPEN) {
-		c->local_window -= win_len;
+		if (win_len > c->local_window)
+			c->local_window = 0;
+		else
+			c->local_window -= win_len;
 		c->local_consumed += win_len;
 		return 0;
 	}

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


More information about the openssh-commits mailing list