android_system_core/libziparchive
Elliott Hughes fba2a1a1ec Fix SEGV in libziparchive with malformed zip file.
d77c99ebc3 changed MappedFile to return a
bogus zero-length mapping on failure rather than nullptr. None of the
calling code was changed, though, and it seems like doing so would be a
bad idea. Revert that part of the change.

Add missing tests, and tidy up some of the logging. Also remove
single-use or obfuscatory constants from the tests.

The new "empty.zip" was created by using zip(1) to create a zip file
with one entry, then using `zip -d` to remove it.

The new "zero-size-cd.zip" was created by using zip(1) to create a zip
file containing a single empty file, and then hex editing the two byte
"size of the central directory" field in the "end of central directory
record" structure at the end of the file. (This is equivalent to, but
much smaller than, the example zip file provided by the bug reporter.)

Bug: http://b/145925341
Test: treehugger
Change-Id: Iff64673bce7dae886ccbc9dd6c2bbe18de19f9d2
2019-12-17 08:39:09 -08:00
..
cli-tests cli-test: a tool for testing command-line programs. 2019-12-13 12:23:51 -08:00
include/ziparchive zipinfo: support DOS attributes. 2019-10-29 07:55:16 -07:00
testdata Fix SEGV in libziparchive with malformed zip file. 2019-12-17 08:39:09 -08:00
.clang-format add a performance benchmark for libziparchive 2017-05-30 10:50:14 -07:00
Android.bp cli-test: a tool for testing command-line programs. 2019-12-13 12:23:51 -08:00
entry_name_utils-inl.h Ziparchive: Enable -Wconversion 2019-04-05 13:50:48 -07:00
entry_name_utils_test.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
libziparchive_fuzzer.cpp libziparchive: add trivial fuzzer. 2019-10-22 11:45:49 -07:00
OWNERS Add OWNERS. 2017-12-07 13:30:03 -08:00
run-ziptool-tests-on-android.sh cli-test: a tool for testing command-line programs. 2019-12-13 12:23:51 -08:00
unzip.cpp cli-test: a tool for testing command-line programs. 2019-12-13 12:23:51 -08:00
zip_archive.cc Fix SEGV in libziparchive with malformed zip file. 2019-12-17 08:39:09 -08:00
zip_archive_benchmark.cpp [zip] Save 1 malloc and memset for each added file in ZipWriter 2019-06-18 21:49:16 -07: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 Fix SEGV in libziparchive with malformed zip file. 2019-12-17 08:39:09 -08:00
zip_archive_stream_entry.cc Ziparchive: Enable -Wconversion 2019-04-05 13:50:48 -07:00
zip_archive_test.cc Fix SEGV in libziparchive with malformed zip file. 2019-12-17 08:39:09 -08:00
zip_writer.cc Avoid using data descriptors in ZIP files when possible. 2019-07-23 06:58:53 +00:00
zip_writer_test.cc Avoid using data descriptors in ZIP files when possible. 2019-07-23 06:58:53 +00:00
ziptool-tests.xml cli-test: a tool for testing command-line programs. 2019-12-13 12:23:51 -08:00