diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index b8af2f09b..a78319ff4 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -171,7 +171,9 @@ static enum match_type identical(LogBufferElement* elem, } // audit message (except sequence number) identical? - if (last->isBinary()) { + if (last->isBinary() && + (lenl > static_cast(sizeof(android_log_event_string_t))) && + (lenr > static_cast(sizeof(android_log_event_string_t)))) { if (fastcmp(msgl, msgr, sizeof(android_log_event_string_t) - sizeof(int32_t))) { return DIFFERENT;