diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2024-09-12 18:24:27 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2024-09-13 11:32:38 +0200 |
commit | 33d55465d9f81863b88d649a46353cc4d19cd253 (patch) | |
tree | 6a0d0a6d0de00bf891d2b6c3be40c13bd629325b /package/source/zippackage/zipfileaccess.cxx | |
parent | 25c9a3e9a5b8c3ea02210271a789f9ebfa90352a (diff) |
tdf#162823 package: fix loss of ODF encrypted basic macros
The problem is that there is a ZipEntry ZipPackageStream::aEntry which
does not necessarily correspond to the values read from the Zip central
directory, because of a call to ZipPackageStream::setSize() in
ZipPackageStream::successfullyWritten() to override nSize and nMethod
for encrypted entries.
This triggers the consistency checks in readLOC(), where this aEntry is
passed.
Refactor things so that ZipPackageStream::aEntry and thus hopefully all
ZipEntry instances correspond to the Zip file's central directory.
For encrypted entries, store the decompressed size (which is read from
manifest.xml) in m_nOwnStreamOrigSize and pass it as a separate
parameter to the ZipFile functions that need it, and ultimately to
XUnbufferedStream, resolving multiple TODO comments.
(regression from commit efae4fc42d5fe3c0a69757226f38efc10d101194)
Change-Id: Ib6ea32595c6027b98da9196a2e2bd0a99b62a983
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173273
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'package/source/zippackage/zipfileaccess.cxx')
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 25944a23e3de..3d442d263817 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -267,7 +267,7 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const OUString& aName ) { xEntryStream = m_pZipFile->getDataStream((*aIter).second, ::rtl::Reference< EncryptionData >(), - false, + {}, m_aMutexHolder); } catch (const container::NoSuchElementException&) @@ -391,7 +391,7 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( { uno::Reference< io::XInputStream > xEntryStream( m_pZipFile->getDataStream( (*aIter).second, ::rtl::Reference< EncryptionData >(), - false, + {}, m_aMutexHolder ) ); if ( !xEntryStream.is() ) |