summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-05-06 12:21:50 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-05-06 17:33:51 +0200
commitffa09959edd087794b1f2fe6b9b6faac484ef74b (patch)
tree8759ba60c383da338668f8d477fcfa3a37b0aca4
parentupdate credits (diff)
downloadcore-libreoffice-7-2.tar.gz
core-libreoffice-7-2.zip
svl: fix crash if user cancels/closes master password dialog libreoffice-7-2
(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/+/133864 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-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 7f4ae8543764..e4606a9a900d 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1098,8 +1098,10 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
do {
aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
- if (m_pStorageFile->getStorageVersion() == 0)
+ if (!aPass.isEmpty() && m_pStorageFile->getStorageVersion() == 0)
+ {
aPass = ReencodeAsOldHash(aPass);
+ }
bResult = ( !aPass.isEmpty() && aPass == m_aMasterPasswd );
aRMode = PasswordRequestMode_PASSWORD_REENTER; // further questions with error notification