[Libreoffice-commits] core.git: package/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 31 06:41:12 UTC 2018


 package/source/zipapi/XBufferedThreadedStream.cxx |    6 +++---
 package/source/zipapi/XBufferedThreadedStream.hxx |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit dacc1b40df67d154c96b256b0d920460f38c3d11
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jul 28 16:33:22 2018 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Jul 31 08:40:49 2018 +0200

    ofz#9597 rethrown IOException not caught by catch IOException
    
    under google oss-fuzz, asan + clang version 6.0.0 (trunk 315613)
    
    when using our own exception thrower, but builtin C++11 support works
    
    also, ofz#9266, ofz#9591, ofz#9597, ofz#9622, etc
    
    Change-Id: I29c692da880b49268284de2f61be07fa94f33bc6
    Reviewed-on: https://gerrit.libreoffice.org/58223
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/package/source/zipapi/XBufferedThreadedStream.cxx b/package/source/zipapi/XBufferedThreadedStream.cxx
index 24c68cfc1fe2..71683cfaf590 100644
--- a/package/source/zipapi/XBufferedThreadedStream.cxx
+++ b/package/source/zipapi/XBufferedThreadedStream.cxx
@@ -32,7 +32,7 @@ private:
         catch (const css::uno::Exception &e)
         {
             SAL_WARN("package", "Unexpected " << e );
-            mxStream.saveException(cppu::getCaughtException());
+            mxStream.saveException(std::current_exception());
         }
 
         mxStream.setTerminateThread();
@@ -107,8 +107,8 @@ const Buffer& XBufferedThreadedStream::getNextBlock()
         if( maPendingBuffers.empty() )
         {
             maInUseBuffer = Buffer();
-            if (maSavedException.hasValue())
-                cppu::throwException(maSavedException);
+            if (maSavedException)
+                std::rethrow_exception(maSavedException);
         }
         else
         {
diff --git a/package/source/zipapi/XBufferedThreadedStream.hxx b/package/source/zipapi/XBufferedThreadedStream.hxx
index b99864fbb268..5feb6e4252e0 100644
--- a/package/source/zipapi/XBufferedThreadedStream.hxx
+++ b/package/source/zipapi/XBufferedThreadedStream.hxx
@@ -37,7 +37,7 @@ private:
     std::condition_variable maBufferProduceResume;
     bool mbTerminateThread;                                 /// indicates the failure of one of the threads
 
-    css::uno::Any maSavedException;                         /// exception caught during unzipping is saved to be thrown during reading
+    std::exception_ptr maSavedException;                    /// exception caught during unzipping is saved to be thrown during reading
 
     static const size_t nBufferLowWater = 2;
     static const size_t nBufferHighWater = 4;
@@ -66,7 +66,7 @@ public:
 
     void produce();
     void setTerminateThread();
-    void saveException(const css::uno::Any &rAny) { maSavedException = rAny; }
+    void saveException(std::exception_ptr exception) { maSavedException = exception; }
 
     // XInputStream
     virtual sal_Int32 SAL_CALL readBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) override;


More information about the Libreoffice-commits mailing list