Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14055459
D18857.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
922 B
Referenced Files
None
Subscribers
None
D18857.diff
View Options
diff --git a/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php b/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php
--- a/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php
+++ b/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php
@@ -192,6 +192,13 @@
$this->state = 'data-bytes';
}
} else if ($this->state == 'data-bytes') {
+ // If we don't have any more bytes on the buffer yet, just bail:
+ // otherwise, we'll emit a pointless and possibly harmful 0-byte data
+ // frame. See T13036 for discussion.
+ if (!strlen($this->buffer)) {
+ break;
+ }
+
$bytes = substr($this->buffer, 0, $this->expectBytes);
$this->buffer = substr($this->buffer, strlen($bytes));
$this->expectBytes -= strlen($bytes);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 12:13 PM (2 d, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6762788
Default Alt Text
D18857.diff (922 B)
Attached To
Mode
D18857: Fix a Mercurial wire protocol parser issue when we receive a length frame before any data
Attached
Detach File
Event Timeline
Log In to Comment