From d0ac36dd66664e3d6953de8b3bdd79eeed8d2e70 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 16 Dec 2011 01:32:43 +0100 Subject: 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). --- package/source/zipapi/ZipFile.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'package/source') 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 ); -- cgit