Merge "Fix heap-buffer-overflow detected by ASAN."
This commit is contained in:
commit
3d028f14c8
1 changed files with 6 additions and 1 deletions
|
|
@ -180,8 +180,13 @@ static enum match_type identical(LogBufferElement* elem,
|
||||||
if (!avcr) return DIFFERENT;
|
if (!avcr) return DIFFERENT;
|
||||||
lenr -= avcr - msgr;
|
lenr -= avcr - msgr;
|
||||||
if (lenl != lenr) return DIFFERENT;
|
if (lenl != lenr) return DIFFERENT;
|
||||||
if (fastcmp<memcmp>(avcl + strlen(avc), avcr + strlen(avc), lenl))
|
// 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 DIFFERENT;
|
||||||
|
}
|
||||||
return SAME;
|
return SAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue