summaryrefslogtreecommitdiffstats
path: root/logcat
diff options
context:
space:
mode:
Diffstat (limited to 'logcat')
-rw-r--r--logcat/logcat.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index 4cd2151..ae56c41 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';