summaryrefslogtreecommitdiffstats
path: root/libziparchive
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-04-10 12:08:22 -0700
committerNarayan Kamath <narayan@google.com>2017-06-14 14:25:55 +0100
commit1d105aa5970659d47bef3ca6fc8a92a43c69c93b (patch)
tree03f318947df2b6deeb8a2f9d54d55f6bd55e5489 /libziparchive
parent550f3bf32827d4d039eeffd92f76b378a1edb8b9 (diff)
downloadsystem_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.cc6
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;