This is an automated email from the ASF dual-hosted git repository.
ardovm pushed a commit to branch mp
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/mp by this push:
new e08dab5466 Fix crash under Windows
e08dab5466 is described below
commit e08dab5466ec183daca089b964db4a2c56fa06ee
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Tue Jun 14 22:57:41 2022 +0200
Fix crash under Windows
MSVC 2008 does not allow operator[] on an empty std::vector
---
main/svl/source/passwordcontainer/passwordcontainer.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/main/svl/source/passwordcontainer/passwordcontainer.cxx
b/main/svl/source/passwordcontainer/passwordcontainer.cxx
index 5c581d46df..ff7f3da14a 100644
--- a/main/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/main/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -542,7 +542,8 @@ vector< ::rtl::OUString >
PasswordContainer::DecodePasswords(const ::rtl::OUStri
rtlCipherError result = rtl_cipher_init (
aDecoder, rtl_Cipher_DirectionDecode,
- code, RTL_DIGEST_LENGTH_MD5, &iv[0], iv.size() );
+ code, RTL_DIGEST_LENGTH_MD5, (iv.size()? &iv[0] : NULL),
+ iv.size() );
if( result == rtl_Cipher_E_None )
{
::rtl::ByteSequence aSeq = getBufFromAsciiLine( aLine );
@@ -596,7 +597,8 @@ vector< ::rtl::OUString >
PasswordContainer::DecodePasswords(const ::rtl::OUStri
rtlCipherError result = rtl_cipher_init (
aEncoder, rtl_Cipher_DirectionEncode,
- code, RTL_DIGEST_LENGTH_MD5, &iv[0], iv.size() );
+ code, RTL_DIGEST_LENGTH_MD5, (iv.size()? &iv[0] : NULL),
+ iv.size() );
if( result == rtl_Cipher_E_None )
{