diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2011-12-16 01:32:43 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-12-16 01:33:51 +0100 |
commit | d0ac36dd66664e3d6953de8b3bdd79eeed8d2e70 (patch) | |
tree | 6a7eab8d092438959fd1d8258a4aff4e5e7449ac /package | |
parent | Fix inconsistent compression method for encrypted ZIP packages. (diff) | |
download | core-d0ac36dd66664e3d6953de8b3bdd79eeed8d2e70.tar.gz core-d0ac36dd66664e3d6953de8b3bdd79eeed8d2e70.zip |
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 ef801f205813..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; } - // check basic local file header / entry consistency + // 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 ); |