From a6754dd558c217cae363e8380efa325004cd4c82 Mon Sep 17 00:00:00 2001 From: Greg Hartman Date: Wed, 15 Feb 2017 21:43:30 -0800 Subject: [PATCH] Fix read past end of malloc block in logd Bug: 35412453 Test: Local build Change-Id: I0f9dee84ef689b042926b6b48abf0caeaa784add --- logd/LogBuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 7613c1e98..e03731b70 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -183,7 +183,8 @@ static enum match_type identical(LogBufferElement* elem, LogBufferElement* last) lenr -= avcr - msgr; if (lenl != lenr) return DIFFERENT; if (fastcmp(avcl + strlen(avc), - avcr + strlen(avc), lenl)) return DIFFERENT; + avcr + strlen(avc), + lenl - strlen(avc))) return DIFFERENT; return SAME; }