diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2011-12-16 01:32:43 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-12-16 09:43:52 +0100 |
commit | b469cd43117c6269db121207e1be5152907b4dd0 (patch) | |
tree | 5aec8aee60610efd88ff79c81bde8adf890d5c1c /package | |
parent | 8edfcee9f858a94fa62c91d633ced9c185b67cd3 (diff) |
Better fix for over-zealous Zip package consistency.
Turns out our encrypted zip package code writes out mismatching
compression methods in central directory and local file headers -
so not only be lenient towards the apple bug (n#653688), but also
ours (i.e. keep not comparing nMethod with nHow).
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 1278f0994558..16d5a0063302 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -686,9 +686,15 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry ) rEntry.sPath = sLOCPath; } - // the method can be reset for internal use so it is not checked + // check basic local file header / entry consistency, just + // plain ignore bits 1 & 2 of the flag field - they are either + // purely informative, or even fully undefined (depending on + // nMethod) + // Do *not* compare nMethod / nHow, older versions with + // encrypted streams write mismatching DEFLATE/STORE pairs + // there. bBroken = rEntry.nVersion != nVersion - || rEntry.nFlag != nFlag + || (rEntry.nFlag & ~6L) != (nFlag & ~6L) || rEntry.nTime != nTime || rEntry.nPathLen != nPathLen || !rEntry.sPath.equals( sLOCPath ); |