From 361d5819d5c9331b0127401435d2f07467148da1 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 9 Nov 2016 14:27:18 +0100 Subject: 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 --- uui/source/iahndl-authentication.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 3edace12ce76..fa7d63f56117 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 const pDialog( + pFact->CreatePasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify)); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); rInfo.SetPassword( pDialog->GetPasswordToOpen() ); -- cgit