diff options
author | 2025-01-28 01:10:11 +0000 | |
---|---|---|
committer | 2025-01-29 05:27:41 +0000 | |
commit | ee2f164e7e67d5ae054cd35e7539731234fc816a (patch) | |
tree | 2aa57fd5ecc14a350e416a072cc8cea6014c7bcd /libs/gui/ConsumerBase.cpp | |
parent | 52b4e75352b247ed97af76972579a2b472d07f73 (diff) |
inputflinger_tests: Fix asan error about new-delete type mismatch
Cast the value returned by InputDispatcher::verifyInputEvent to the
correct event type and call delete explicitly on the pointer. This
fixes the `new-delete-type-mismatch` reported by asan with
clang-r547379.
We cannot rely on virtual destructor calls because InputEvent and
subclasses don't have a virtual destructor. The proper fix is to either
consider using std::variant in some way, or introduce an intermediate
POD data structure that we will put the data into just prior to signing.
Adding virtual functions to these classes is undesirable as the bytes in
these objects are getting signed.
Bug: 392703785
Test: run inputflinger_tests on the host with aosp/3419479
Change-Id: Ie78684539536c8b62acc8d540df57b2bbaac3649
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
0 files changed, 0 insertions, 0 deletions