diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-30 09:48:13 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-30 09:48:13 +0000 |
commit | fe0e3580e84847c46d653cee01e8e52334475192 (patch) | |
tree | d1342c498099db76a78f81f8df87e673a198de4b /package | |
parent | 32be2ae62aaf7b8eb5621f68be507088410781de (diff) |
coverity#706584 Uncaught exception
Change-Id: I9521ed7d75cae1a1e90fd73dd7b8bd822ab4521f
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 63fee5d30771..7543bc6da55c 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/io/XTruncate.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/ucb/IOErrorCode.hpp> #include <ucbhelper/content.hxx> @@ -869,7 +870,8 @@ sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) if ( ( nIndex = aName.getLength() ) == 1 && *aName.getStr() == '/' ) return sal_True; - else + + try { nStreamIndex = aName.lastIndexOf ( '/' ); bool bFolder = nStreamIndex == nIndex-1; @@ -935,8 +937,19 @@ sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) return sal_True; } } - return sal_False; } + catch (const uno::RuntimeException &) + { + throw; + } + catch (const uno::Exception&) + { + uno::Any e(::cppu::getCaughtException()); + throw lang::WrappedTargetRuntimeException( + OUString("ZipPackage::hasByHierarchicalName"), + 0, uno::makeAny(e)); + } + return sal_False; } uno::Reference< XInterface > SAL_CALL ZipPackage::createInstance() |