summaryrefslogtreecommitdiff
path: root/package/source/zippackage/ZipPackageStream.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-23 11:24:55 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-23 11:40:35 +0200
commit8d8b9b80b114b94b20b0bf1438d80e925b49e3bf (patch)
treea7cd922f6c5b94138934e8687a2c5f41a7d37185 /package/source/zippackage/ZipPackageStream.cxx
parentcd292ba17c62a90f3530326f7fc87036da16a353 (diff)
package: fix exception handling in DeflateThread (related tdf#91807)
In the bugdoc of tdf#91807 there are at least 49 corrupt zip streams that raise exceptions in the DeflateThreads. Because the maximum allowed number of threads happens to be 48, this results in an infinite loop in ZipOutputStream::reduceScheduledThreadsToGivenNumberOrLess(). (regression from 7e2ea27e5d56f5cf767a6718a0f5edc28e24af14) In case an exception is thrown, don't re-throw it immediately, which might cause trouble such as leaking all of the ZipOutputEntry instances in m_aEntries. Change-Id: Ia74ab8e46fa1349c049d05dbec3454bfbe7d61d9
Diffstat (limited to 'package/source/zippackage/ZipPackageStream.cxx')
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 43a9b8567aa0..5efb145fd9f7 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -486,6 +486,17 @@ private:
catch (const uno::Exception&)
{
mpEntry->setParallelDeflateException(::cppu::getCaughtException());
+ try
+ {
+ if (mpEntry->m_xOutStream.is())
+ mpEntry->closeBufferFile();
+ if (!mpEntry->m_aTempURL.isEmpty())
+ mpEntry->deleteBufferFile();
+ }
+ catch (uno::Exception const&)
+ {
+ }
+ mpEntry->setFinished();
}
}
};