]> Cypherpunks repositories - gostls13.git/commit
exp/ssh: fix two flow control bugs in chanWriter
authorDave Cheney <dave@cheney.net>
Wed, 4 Jan 2012 15:36:21 +0000 (10:36 -0500)
committerAdam Langley <agl@golang.org>
Wed, 4 Jan 2012 15:36:21 +0000 (10:36 -0500)
commit424f53fa0c60fd62cb77186ffb9643dae5429a5c
treef464a76158457841ed3d5a24c74684d434a8f985
parent9d92676f63c3de78eeaab302bc5868308e6af5ad
exp/ssh: fix two flow control bugs in chanWriter

This CL fixes two issues sending data to the remote peer.
The first bug occurs when the size of the buffer passed to
Write is larger than the current window, in this case, w.rwin
can become negative.

The second issue is more problematic than the first as the
amount of data passed to writePacket was not limited to w.rwin.
In this case the remote peer could silently drop the additional
data, or drop the connection.

Credit to Jacek Masiulaniec for the bug report.

R=agl, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/5511043
src/pkg/exp/ssh/client.go