Merge "Fix heap-buffer-overflow detected by ASAN."
This commit is contained in:
commit
affc6cd0ed
1 changed files with 4 additions and 1 deletions
|
|
@ -182,7 +182,10 @@ static enum match_type identical(LogBufferElement* elem, LogBufferElement* last)
|
|||
if (!avcr) return DIFFERENT;
|
||||
lenr -= avcr - msgr;
|
||||
if (lenl != lenr) return DIFFERENT;
|
||||
if (fastcmp<memcmp>(avcl + strlen(avc),
|
||||
// TODO: After b/35468874 is addressed, revisit "lenl > strlen(avc)"
|
||||
// condition, it might become superflous.
|
||||
if (lenl > strlen(avc) &&
|
||||
fastcmp<memcmp>(avcl + strlen(avc),
|
||||
avcr + strlen(avc),
|
||||
lenl - strlen(avc))) return DIFFERENT;
|
||||
return SAME;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue