diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2011-12-14 13:30:34 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-12-14 13:31:55 +0100 |
commit | 309f56174aca6adca879f70958892492361dac6e (patch) | |
tree | 561a39832fd65bcc52930f17f24d0852caea2dd7 /package | |
parent | 0e6122ade866dfb28979646da6216c54d4d122db (diff) |
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.
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 1278f0994558..4fd8aeab276d 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -688,7 +688,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 ); @@ -698,6 +698,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!" ) ), uno::Reference< XInterface >() ); |