[Libreoffice-commits] .: Branch 'libreoffice-3-4' - package/source
Petr Mladek
pmladek at kemper.freedesktop.org
Wed Dec 14 06:31:43 PST 2011
package/source/zipapi/ZipFile.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 4481a2fd1a40b27c1f8e784517b79fcc3c3ca196
Author: Thorsten Behrens <tbehrens at suse.com>
Date: Wed Dec 14 13:30:34 2011 +0100
Fix n#653688
Seems our Zip package is a bit too strict in checking archive
consistency - surely writing it out correctly is good, but rejecting
otherwise fine odf is not.
Signed-off-by: Michael Meeks <michael.meeks at suse.com>
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index fb56c28..03a0108 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -802,7 +802,7 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
// the method can be reset for internal use so it is not checked
bBroken = rEntry.nVersion != nVersion
- || rEntry.nFlag != nFlag
+ || rEntry.nMethod != nHow
|| rEntry.nTime != nTime
|| rEntry.nPathLen != nPathLen
|| !rEntry.sPath.equals( sLOCPath );
@@ -812,6 +812,12 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
bBroken = sal_True;
}
+ // ignore bits 1 & 2 for normal deflate algo - they're purely informative
+ if( nHow != 8 && nHow != 9 )
+ bBroken = bBroken || rEntry.nFlag != nFlag;
+ else if( (rEntry.nFlag & ~6L) != (nFlag & ~6L) )
+ bBroken = true;
+
if ( bBroken && !bRecoveryMode )
throw ZipIOException( OUString( RTL_CONSTASCII_USTRINGPARAM( "The stream seems to be broken!" ) ),
Reference< XInterface >() );
More information about the Libreoffice-commits
mailing list