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

am: e963876bd0

Change-Id: I289f204fc1609e5124a0a0698ae125a721940e79
This commit is contained in:
Mark Salyzyn 2018-03-13 22:10:13 +00:00 committed by android-build-merger
commit 7352e86d98
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;