From fe0e3580e84847c46d653cee01e8e52334475192 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Oct 2014 09:48:13 +0000 Subject: coverity#706584 Uncaught exception Change-Id: I9521ed7d75cae1a1e90fd73dd7b8bd822ab4521f --- package/source/zippackage/ZipPackage.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'package/source') 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 #include #include +#include #include #include #include @@ -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() -- cgit