diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-07-28 16:33:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-07-31 08:40:49 +0200 |
commit | dacc1b40df67d154c96b256b0d920460f38c3d11 (patch) | |
tree | 1aa90ab00e0dd639050980f892d75e87df88f2ff /package | |
parent | 108d4a6391eee22642fcb18ba429c2c9f4d8c818 (diff) |
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@redhat.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zipapi/XBufferedThreadedStream.cxx | 6 | ||||
-rw-r--r-- | package/source/zipapi/XBufferedThreadedStream.hxx | 4 |
2 files changed, 5 insertions, 5 deletions
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; |