[Libreoffice-commits] core.git: uui/source

Michael Stahl mstahl at redhat.com
Wed Nov 9 13:33:00 UTC 2016


 uui/source/iahndl-authentication.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 361d5819d5c9331b0127401435d2f07467148da1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 9 14:27:18 2016 +0100

    uui: fix use-after-free on password dialog
    
    VclPtr returned from CreatePasswordToOpenModifyDialog implicitly
    converts to plain pointer then deletes the dialog.
    
    (regression from some vclptr refactoring)
    
    Change-Id: I4ccdeabcd6ee718104c0f7f65d67a20ce2c70ca3

diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index 3edace1..fa7d63f 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -528,8 +528,8 @@ executePasswordDialog(
                 const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0;   // 0 -> allow any length
 
                 VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create();
-                AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, nMaxPasswdLen, bIsPasswordToModify );
-                ScopedVclPtr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp );
+                ScopedVclPtr<AbstractPasswordToOpenModifyDialog> const pDialog(
+                    pFact->CreatePasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify));
 
                 rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
                 rInfo.SetPassword( pDialog->GetPasswordToOpen() );


More information about the Libreoffice-commits mailing list