logd: Logging is truncated
- stack buffer undersized
Bug: 13514601
Change-Id: I3e5dda2daa7531ddcacece33dfdecaa28dcca765
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index c6b248b..2aa2ebb 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -31,7 +31,8 @@
{ }
bool LogListener::onDataAvailable(SocketClient *cli) {
- char buffer[1024];
+ char buffer[sizeof_log_id_t + sizeof(log_time) + sizeof(char)
+ + LOGGER_ENTRY_MAX_PAYLOAD];
struct iovec iov = { buffer, sizeof(buffer) };
memset(buffer, 0, sizeof(buffer));