Index: tools/android/forwarder2/daemon.cc |
diff --git a/tools/android/forwarder2/daemon.cc b/tools/android/forwarder2/daemon.cc |
index d99383446c819ec4893af0b72d0adaa1a86863c3..88ec8a01ab7547210d2a995fd3891144837d6699 100644 |
--- a/tools/android/forwarder2/daemon.cc |
+++ b/tools/android/forwarder2/daemon.cc |
@@ -141,7 +141,7 @@ scoped_ptr<Socket> ConnectToUnixDomainSocket( |
char buf[kBufferSize]; |
DCHECK(expected_welcome_message.length() + 1 <= sizeof(buf)); |
memset(buf, 0, sizeof(buf)); |
- if (socket->Read(buf, sizeof(buf)) < 0) { |
+ if (socket->Read(buf, expected_welcome_message.length() + 1) < 0) { |
perror("read"); |
continue; |
} |