svl/source/passwordcontainer/passwordcontainer.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 74e1b3f855c7f0349577681601dd1eb11917dd06 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Fri May 6 12:21:50 2022 +0200 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Fri May 6 18:39:47 2022 +0200 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.st...@allotropia.de> (cherry picked from commit bbb8617ece6d946957c2eb96287081029bce530f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133866 Reviewed-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> Reviewed-by: Luboš Luňák <l.lu...@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> 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