summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-05-06 12:21:50 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-05-07 21:25:17 +0200
commitb34fd1309db0f8968f124a92eca8f3f1ba7fbf7a (patch)
tree01a233e433fbf4ae61a0ba46044a98ccb831c2da /svl
parentdad860ac671dd629401ecdf62b804e6e42b176ec (diff)
svl: fix crash if user cancels/closes master password dialog
(regression from d7ba5614d90381d68f880ca7e7c5ef8bbb1b1c43) Change-Id: I8bb9a967aefa2e88f05c23456a0dd1a090e1a5fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133932 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit bbb8617ece6d946957c2eb96287081029bce530f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133863 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 4dd36e732108..6bbb01497a30 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1096,8 +1096,10 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
do {
aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
- if (m_xStorageFile->getStorageVersion() == 0)
+ if (!aPass.isEmpty() && m_xStorageFile->getStorageVersion() == 0)
+ {
aPass = ReencodeAsOldHash(aPass);
+ }
bResult = ( !aPass.isEmpty() && aPass == m_aMasterPassword );
aRMode = PasswordRequestMode_PASSWORD_REENTER; // further questions with error notification