Fix read past end of malloc block in logd

Bug: 35412453
Test: Local build
Change-Id: I0f9dee84ef689b042926b6b48abf0caeaa784add
This commit is contained in:
Greg Hartman 2017-02-15 21:43:30 -08:00
parent 3ce7d82aa3
commit a6754dd558
1 changed files with 2 additions and 1 deletions

View File

@ -183,7 +183,8 @@ static enum match_type identical(LogBufferElement* elem, LogBufferElement* last)
lenr -= avcr - msgr;
if (lenl != lenr) return DIFFERENT;
if (fastcmp<memcmp>(avcl + strlen(avc),
avcr + strlen(avc), lenl)) return DIFFERENT;
avcr + strlen(avc),
lenl - strlen(avc))) return DIFFERENT;
return SAME;
}