summaryrefslogtreecommitdiff
path: root/adb/file_sync_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adb/file_sync_client.cpp')
-rw-r--r--adb/file_sync_client.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp
index 2576fb15bb..26f8d831ca 100644
--- a/adb/file_sync_client.cpp
+++ b/adb/file_sync_client.cpp
@@ -441,7 +441,7 @@ class SyncConnection {
syncsendbuf sbuf;
sbuf.id = ID_DATA;
while (true) {
- int bytes_read = adb_read(lfd, sbuf.data, max);
+ int bytes_read = adb_read(lfd, sbuf.data, max - sizeof(SyncRequest));
if (bytes_read == -1) {
Error("reading '%s' locally failed: %s", lpath, strerror(errno));
adb_close(lfd);