Merge "logd: identical check access message data out of range"

This commit is contained in:
Treehugger Robot 2018-03-13 21:51:53 +00:00 committed by Gerrit Code Review
commit 887d74b479
1 changed files with 3 additions and 1 deletions

View File

@ -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<ssize_t>(sizeof(android_log_event_string_t))) &&
(lenr > static_cast<ssize_t>(sizeof(android_log_event_string_t)))) {
if (fastcmp<memcmp>(msgl, msgr, sizeof(android_log_event_string_t) -
sizeof(int32_t))) {
return DIFFERENT;