diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-04-10 12:08:22 -0700 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2017-06-14 14:25:55 +0100 |
commit | 1d105aa5970659d47bef3ca6fc8a92a43c69c93b (patch) | |
tree | 03f318947df2b6deeb8a2f9d54d55f6bd55e5489 /libziparchive | |
parent | 550f3bf32827d4d039eeffd92f76b378a1edb8b9 (diff) | |
download | system_core-1d105aa5970659d47bef3ca6fc8a92a43c69c93b.tar.gz system_core-1d105aa5970659d47bef3ca6fc8a92a43c69c93b.tar.bz2 system_core-1d105aa5970659d47bef3ca6fc8a92a43c69c93b.zip |
libziparchive: verify that gpb flags match
The Central File Header and Local File Header should
have the same general purpose bit flags set for
consistency.
Bug: 36686974
Test: existing tests pass (ziparchive-tests)
(cherry picked from commit 73b3aa541f1ad3fff961c9423dbaaf048452ca4b)
Change-Id: Ia672a28732154a564ea2f2e3520238bb77924a56
Diffstat (limited to 'libziparchive')
-rw-r--r-- | libziparchive/zip_archive.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc index 246575f81..a3896fc08 100644 --- a/libziparchive/zip_archive.cc +++ b/libziparchive/zip_archive.cc @@ -564,9 +564,9 @@ static int32_t FindEntry(const ZipArchive* archive, const int ent, // Paranoia: Match the values specified in the local file header // to those specified in the central directory. - // Verify that the central directory and local file header agree on the use of a trailing - // Data Descriptor. - if ((lfh->gpb_flags & kGPBDDFlagMask) != (cdr->gpb_flags & kGPBDDFlagMask)) { + // Verify that the central directory and local file header have the same general purpose bit + // flags set. + if (lfh->gpb_flags != cdr->gpb_flags) { ALOGW("Zip: gpb flag mismatch. expected {%04" PRIx16 "}, was {%04" PRIx16 "}", cdr->gpb_flags, lfh->gpb_flags); return kInconsistentInformation; |