platform_system_core/libziparchive
Nick Kralevich a4e5433660 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
2019-04-04 14:53:11 -07:00
..
include/ziparchive More Mac build fixes. 2018-10-26 10:53:24 -07:00
testdata Check filename memory bound when parsing ziparchive 2017-06-30 17:19:28 +09:00
.clang-format add a performance benchmark for libziparchive 2017-05-30 10:50:14 -07:00
Android.bp libziparchive: add integer checks 2019-03-20 13:04:02 -07:00
OWNERS Add OWNERS. 2017-12-07 13:30:03 -08:00
entry_name_utils-inl.h entry_name_utils-inl.h: clear top bit before shifting 2019-03-21 09:29:31 -07:00
entry_name_utils_test.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
unzip.cpp Add libziparchive-based unzip. 2017-06-04 11:53:48 -07:00
zip_archive.cc zip_archive.cc: fix ubsan false positive 2019-04-04 14:53:11 -07:00
zip_archive_benchmark.cpp BENCHMARK_MAIN now requires a semicolon. 2017-12-13 18:19:18 -08:00
zip_archive_common.h Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
zip_archive_private.h Add a simple MappedFile to libbase and switch fastboot and libziparchive over. 2018-10-23 13:20:49 -07:00
zip_archive_stream_entry.cc libziparchive: Use ReadAtOffset exclusively 2017-07-25 18:12:12 +00:00
zip_archive_test.cc Fix double closes in ziparchive tests. 2018-11-16 19:54:41 +00:00
zip_writer.cc zip_writer.cc: update powerof2 and use it unconditionally 2019-03-27 10:24:44 -07:00
zip_writer_test.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00