summaryrefslogtreecommitdiffstats
path: root/liblog/pmsg_reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'liblog/pmsg_reader.c')
-rw-r--r--liblog/pmsg_reader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/liblog/pmsg_reader.c b/liblog/pmsg_reader.c
index a4eec65a5..679c15957 100644
--- a/liblog/pmsg_reader.c
+++ b/liblog/pmsg_reader.c
@@ -343,6 +343,10 @@ LIBLOG_ABI_PRIVATE ssize_t __android_log_pmsg_file_read(
char *msg = (char *)&transp.logMsg + hdr_size;
char *split = NULL;
+ if ((hdr_size < sizeof(transp.logMsg.entry_v1)) ||
+ (hdr_size > sizeof(transp.logMsg.entry))) {
+ continue;
+ }
/* Check for invalid sequence number */
if ((transp.logMsg.entry.nsec % ANDROID_LOG_PMSG_FILE_SEQUENCE) ||
((transp.logMsg.entry.nsec / ANDROID_LOG_PMSG_FILE_SEQUENCE) >=