summaryrefslogtreecommitdiffstats
path: root/libziparchive/zip_archive_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* libziparchive: fix issue with a directory with one fileMykola Kondratenko2015-03-191-0/+16
| | | | | | | | | libziparchive fails to iterate some bootanimation archives reporting invalid offset error. This is caused by failure to process a directory with one file (when name_offset + file_name_length == cd_offset). Change-Id: I2733e7f782c14a6fadd5491bb94318ac968df206
* Add close_file flag to OpenArchiveFd()Dmitriy Ivanov2015-01-301-0/+21
| | | | | | * We should be able to keep fd alive after CloseArchive() Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
* Replace char* with ZipEntryName in ziparchive API.Piotr Jastrzebski2014-08-151-6/+45
| | | | | | | | | It's important because entry names can be encoded in UTF-8 and can have \0 character in the middle. Use vector instead of char* for prefix in IterationHandle. Bug: 16162465 Change-Id: Ie34c8d7c6231cc258530c22bdde5542895213649
* Prevent the accidental closure of fd[0] for missing zip files.Neil Fuller2014-07-251-0/+9
| | | | | Bug: 16530747 Change-Id: I3593f2bc4d56a2f91252ea795c90ce3c78e1ec06
* Replace hand written offsets with structures.Narayan Kamath2014-06-101-4/+19
| | | | | | | | | | | | | | Given that all current & future android ABIs are little endian, we can get rid of the explicit conversions from memory regions to little endian data members. Also cleans up a few C style casts that snuck in during several -Werror efforts and fixes temporary file generation on target. bug: 15448202 Change-Id: I4fcbb3c1124cb82c82139d328344e54fc7895353
* Reject zip files that have trailing bytes after their CD.Narayan Kamath2014-06-051-7/+24
| | | | | bug: 15287086 Change-Id: I03219c4c2ca6afc9d417a35bd98ae682f478fc25
* Fix host 64-bit build.Ying Wang2014-05-161-2/+2
| | | | | Bug: 13751317 Change-Id: Ib42d24408d053bacc24142ed18fc5f3181d2345b
* Fix entry handling for 0 length entries.Narayan Kamath2014-01-241-1/+38
| | | | | | | | | | | | | | | | Two minor issues were fixed: - The offset to entry data can be the same as the central directory offset when the last entry in the file has length 0 and is stored (not deflated). Fix a check that disallowed this. We already have a strict check that entry data must end before the central directory, so we're covered. - We would attempt to map a segment of length 0 when writing an entry whose length is 0. We should just return early in this case. bug: 12623277 Change-Id: I2a4ca0c4d170cc3cbf326e5ca13894acd9c434c9
* Fix ExtractEntryToFile.Narayan Kamath2013-12-131-1/+42
| | | | | | | | | We would always write uncompressed data at offset 0 instead of the current filedescriptor offset. Also adds a unit-test & a clarifying comment on the API. Change-Id: If44757e96dde504ce63d81b4dec7115fc6f6d5fb
* Add unit tests for libziparchive.Narayan Kamath2013-12-101-14/+140
| | | | | | | | | - Add a build rule for host tests - Add basic tests for Find / Iterate and Extract for both deflated & stored entries. - Fix an off by one error that the test uncovered. Change-Id: If72009b1ea9791d5a265829f05c32ffe1c2752c4
* Unify zipfile implementations : Step 1.Narayan Kamath2013-12-041-0/+46
Extract zip file processing logic from libdvm into a standalone library. This library is a stricter than the libdvm library in several ways: - Duplicate zip entry names are now disallowed. Files with such entries will fail to parse. - We now verify CD file size information with the individual file header information. (This was pointed out as a deficiency of this implementation in past discussions.) - We also add support for crc checking, which means we might need to parse the optional data descriptor footer (if one exists). We also provide an API for iterating over the entries of a zip file. This library is optimized for two use cases : - Lookup for a single entry in the file, with the intention of processing or extracting the data associated with that entry - Iterating over all entries in a file *and* processing / extracting their data. Change-Id: Ia87de6184ef753cc470b0af755c47a4f92ac8198