From b166135056a784be4700b1c1d83975289b7f99ea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 13 Jul 2014 20:35:09 +0100 Subject: coverity#983698 Uncaught exception Change-Id: I3f597643c1f743314ca17346901f11dc4f1f7302 --- package/source/xstor/owriteablestream.cxx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'package/source') diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index eb4b75d160d6..22e21d239cd2 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -2587,12 +2587,33 @@ sal_Bool SAL_CALL OWriteStream::hasEncryptionData() ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); if (!m_pImpl) - return sal_False; + return false; + + bool bRet = false; - bool bRet = m_pImpl->IsEncrypted(); + try + { + bRet = m_pImpl->IsEncrypted(); - if (!bRet && m_pImpl->m_bUseCommonEncryption && m_pImpl->m_pParent) - bRet = m_pImpl->m_pParent->m_bHasCommonEncryptionData; + if (!bRet && m_pImpl->m_bUseCommonEncryption && m_pImpl->m_pParent) + bRet = m_pImpl->m_pParent->m_bHasCommonEncryptionData; + } + catch( const uno::RuntimeException& rRuntimeException ) + { + m_pImpl->AddLog( rRuntimeException.Message ); + m_pImpl->AddLog( "Rethrow" ); + throw; + } + catch( const uno::Exception& rException ) + { + m_pImpl->AddLog( rException.Message ); + m_pImpl->AddLog( "Rethrow" ); + + uno::Any aCaught( ::cppu::getCaughtException() ); + throw lang::WrappedTargetRuntimeException( "Problems on hasEncryptionData!", + static_cast< ::cppu::OWeakObject* >( this ), + aCaught ); + } return bRet; } -- cgit v1.2.3