Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d028f14 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix heap-buffer-overflow detected by ASAN."

parents 97a2c49a 03fc2fed
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -180,8 +180,13 @@ static enum match_type identical(LogBufferElement* elem,
    if (!avcr) return DIFFERENT;
    lenr -= avcr - msgr;
    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 SAME;
}