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

Skip to content
Commit 42e79138 authored by Daniele Di Proietto's avatar Daniele Di Proietto
Browse files

FenceTime: Fix undefined behavior

std::unordered_map::erase() invalidates iterators to the erased
elements. Using erase() inside a range based for loop can lead to
undefined behavior, because the loop holds the same iterator that are
invalidated.

Fix the problem by using an interator directly and incrementng only when
it makes sense.

This was found by surfaceflinger_frametracer_fuzzer running with asan
(not hwasan!).

TESTED=only fuzzer

Bug: 307601836
Change-Id: Id99feaec21300dbd55d35acba67801b2483dd144
parent fed5eb68
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment