diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-11-07 12:11:40 +0200 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-11-15 17:03:55 +0200 |
commit | 936708b2d947917be5aed3de0b0de85ded2d3283 (patch) | |
tree | 6a0a3a20cac57de8a6aff6d6314a1dc7f5a1d78e /daemon/gvfsbackendsftp.c | |
parent | ff870666620b48f9563d7c587b56ed06c349a96c (diff) | |
download | gvfs-936708b2d947917be5aed3de0b0de85ded2d3283.tar.gz |
sftp: Fix handling of multiple reads of the packet length
In certain cases, reading the packet length may take more than one call.
Make this work by calculating the offset into the reply_size correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=532951
Diffstat (limited to 'daemon/gvfsbackendsftp.c')
-rw-r--r-- | daemon/gvfsbackendsftp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c index 23d5b00e..2098fd54 100644 --- a/daemon/gvfsbackendsftp.c +++ b/daemon/gvfsbackendsftp.c @@ -1245,7 +1245,7 @@ read_reply_async_got_len (GObject *source_object, if (backend->reply_size_read < 4) { g_input_stream_read_async (backend->reply_stream, - &backend->reply_size + backend->reply_size_read, 4 - backend->reply_size_read, + (char *)&backend->reply_size + backend->reply_size_read, 4 - backend->reply_size_read, 0, backend->reply_stream_cancellable, read_reply_async_got_len, backend); return; |