summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-23 11:24:55 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-06-24 15:05:15 +0000
commitf8a132e58e2fa4328e47b19bd49386641d115221 (patch)
treee6a8ae6875ee03cf1bac36d0879908c933f769ab /sfx2/source
parentc5320ed05f51482a37993420068e754223f08d5c (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. (cherry picked from commit 8d8b9b80b114b94b20b0bf1438d80e925b49e3bf) sfx2: exception on storage commit is an error (related: tdf#91807) For no good or obvious reason, SfxMedium::StorageCommit_Impl() swallows embed::UseBackupException if there is a pTempFile, which (as the comment claims) is "always now". This results in the temp file actually being copied to the user-visible file and the SaveAs "succeeding", when it clearly did not. Also move the exception throwing to the end of ZipOutputStream::finish() to avoid more memory leaks. (cherry picked from commit 9084c11fb472f2024e609770ce922c911227e7a8) Change-Id: I448cc43291754ef20adfa6b65916282fcc365a11 Reviewed-on: https://gerrit.libreoffice.org/26619 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/docfile.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 184a307f09df..6a0c4c9f927d 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1625,10 +1625,10 @@ bool SfxMedium::StorageCommit_Impl()
OSL_ENSURE( !pImpl->m_aName.isEmpty(), "The exception _must_ contain the temporary URL!\n" );
}
}
-
- if ( !GetError() )
- SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
}
+
+ if (!GetError())
+ SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
}
catch ( const uno::Exception& )
{