diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp index 4cd21514f..ae56c411b 100644 --- a/logcat/logcat.cpp +++ b/logcat/logcat.cpp @@ -296,6 +296,11 @@ static void readLogLines(log_device_t* devices) fprintf(stderr, "read: Unexpected EOF!\n"); exit(EXIT_FAILURE); } + else if (entry->entry.len != ret - sizeof(struct logger_entry)) { + fprintf(stderr, "read: unexpected length. Expected %d, got %d\n", + entry->entry.len, ret - sizeof(struct logger_entry)); + exit(EXIT_FAILURE); + } entry->entry.msg[entry->entry.len] = '\0';