Commit ee2f164
committed
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: Ie78684539536c8b62acc8d540df57b2bbaac36491 parent 52b4e75 commit ee2f164
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8132 | 8132 | | |
8133 | 8133 | | |
8134 | 8134 | | |
| 8135 | + | |
| 8136 | + | |
| 8137 | + | |
| 8138 | + | |
| 8139 | + | |
| 8140 | + | |
| 8141 | + | |
| 8142 | + | |
| 8143 | + | |
| 8144 | + | |
| 8145 | + | |
8135 | 8146 | | |
8136 | 8147 | | |
8137 | 8148 | | |
| |||
8179 | 8190 | | |
8180 | 8191 | | |
8181 | 8192 | | |
| 8193 | + | |
| 8194 | + | |
| 8195 | + | |
| 8196 | + | |
8182 | 8197 | | |
8183 | 8198 | | |
8184 | 8199 | | |
| |||
0 commit comments