[Libreoffice-commits] .: package/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon May 28 07:35:50 PDT 2012
package/source/zipapi/ZipFile.cxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 78f614e5fff70d4874322255cca739f430865f0a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 28 10:33:40 2012 +0100
check key size
Change-Id: Ia909b0abb3ef84a9f0a14d42379f693ae9e70812
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 16d5a00..f154dfe 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -157,6 +157,12 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
try
{
+ if (xEncryptionData->m_nDerivedKeySize < 0)
+ {
+ throw ZipIOException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid derived key length!") ),
+ uno::Reference< XInterface >() );
+ }
+
uno::Sequence< sal_Int8 > aDerivedKey( xEncryptionData->m_nDerivedKeySize );
if ( rtl_Digest_E_None != rtl_digest_PBKDF2( reinterpret_cast< sal_uInt8* >( aDerivedKey.getArray() ),
aDerivedKey.getLength(),
@@ -192,7 +198,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
uno::Reference< XInterface >() );
}
}
- catch( uno::Exception& )
+ catch( ... )
{
OSL_ENSURE( sal_False, "Can not create cipher context!" );
}
@@ -699,7 +705,7 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
|| rEntry.nPathLen != nPathLen
|| !rEntry.sPath.equals( sLOCPath );
}
- catch(::std::bad_alloc &)
+ catch(...)
{
bBroken = sal_True;
}
More information about the Libreoffice-commits
mailing list