diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-06 12:21:50 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-05-13 16:41:10 +0200 |
commit | d36b69a6f9cd1ed8af158d4596aa0252adbef662 (patch) | |
tree | 250d68bfcff853e099667a65f1db7653fb478314 /svl | |
parent | 8c1926278915207904f4aead375b888e164e98a5 (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.cxx | 4 |
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 |