diff options
author | 2022-05-05 17:18:48 +0000 | |
---|---|---|
committer | 2022-07-08 13:02:33 -0400 | |
commit | ae78558b2b76ea241e0aaba09c22dd2d8c24210c (patch) | |
tree | 4bbe912c56472b5874572d6d9f72203c11854118 /libs/binder/Parcel.cpp | |
parent | ec0d68e94557ade17f1729aedfb0b5cad97c8427 (diff) |
libbinder: Allow vector construction from unaligned data.
std::vector::insert(const_iterator pos, ...) requires that
`pos` be aligned to the size of the type it points to, e.g.
8 byte aligned for an int64_t iterator, to avoid undefined
behavior. In cases where the type is trivially copyable,
it is safe to memcpy the contents of the buffer directly
into the vector. This change does not cover non-trivially-copyable
types that are not aligned to their size within `data`.
Bug: None
Test: run AIDL client / server tests
Change-Id: Ie1a44659e79f7a07cf6c3b318870d0279e1516ce
Diffstat (limited to 'libs/binder/Parcel.cpp')
0 files changed, 0 insertions, 0 deletions