diff options
author | Nick Kralevich <nnk@google.com> | 2019-04-04 14:19:43 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2019-04-04 14:53:11 -0700 |
commit | a4e5433660228dae47530518bfb6fc49723f8882 (patch) | |
tree | b715114847be079fc5133ff821f28bc8b6c8a193 /libpackagelistparser/packagelistparser_test.cpp | |
parent | 5c58e092f3df0e70235a4cdd41790a505e1ee596 (diff) |
zip_archive.cc: fix ubsan false positive
std::hash returns a 64 bit value, which is truncated to a 32 bit value
in ComputeHash. ubsan's implicit-unsigned-integer-truncation doesn't
like this implicit truncation and crashes the program. Explicitly strip
off the top order bits after computing the hash.
Remove the windows specific version of the hash computation. The windows
compile now uses clang, so this code is obsolete. This also avoids us
having to add __attribute__((no_sanitize("integer"))) to the windows
code.
This is needed to support Android booting with ubsan's
implicit-unsigned-integer-truncation option enabled.
Test: compiles and boots
Bug: 122975762
Change-Id: I2f05fbf5ffee8e90a66a6fda32e80de9cca246c0
Diffstat (limited to 'libpackagelistparser/packagelistparser_test.cpp')
0 files changed, 0 insertions, 0 deletions