Kaydet (Commit) 566b6f6e authored tarafından Michael Stahl's avatar Michael Stahl

coverity#1427631 sfx2: fix silly infinite loop

(regression from 9ef1734f)

Change-Id: I31dc5e7aff80f647d8417c290f8f34c43e54486d
üst d27561ad
......@@ -2669,25 +2669,27 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest( new ::comphelper::DocPasswordRequest( eType, css::task::PasswordRequestMode_PASSWORD_CREATE, aURL, bool( pCurrentFilter->GetFilterFlags() & SfxFilterFlags::PASSWORDTOMODIFY ) ) );
uno::Reference< css::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
do {
do
{
xInteractionHandler->handle( rRequest );
if (pPasswordRequest->isPassword() && !bMSType)
if (!pPasswordRequest->isPassword() || bMSType)
{
OString const utf8Pwd(OUStringToOString(pPasswordRequest->getPassword(), RTL_TEXTENCODING_UTF8));
OString const utf8Ptm(OUStringToOString(pPasswordRequest->getPasswordToModify(), RTL_TEXTENCODING_UTF8));
if (!(52 <= utf8Pwd.getLength() && utf8Pwd.getLength() <= 55
&& SvtSaveOptions().GetODFDefaultVersion() < SvtSaveOptions::ODFVER_012)
&& !(52 <= utf8Ptm.getLength() && utf8Ptm.getLength() <= 55))
{
break;
}
ScopedVclPtrInstance<MessBox>(Application::GetDefDialogParent(),
MessBoxStyle::Ok, 0, "Password length",
"The password you have entered causes interoperability issues. Please enter a password that is shorter than 52 bytes, or longer than 55 bytes."
)->Execute();
break;
}
} while (true);
OString const utf8Pwd(OUStringToOString(pPasswordRequest->getPassword(), RTL_TEXTENCODING_UTF8));
OString const utf8Ptm(OUStringToOString(pPasswordRequest->getPasswordToModify(), RTL_TEXTENCODING_UTF8));
if (!(52 <= utf8Pwd.getLength() && utf8Pwd.getLength() <= 55
&& SvtSaveOptions().GetODFDefaultVersion() < SvtSaveOptions::ODFVER_012)
&& !(52 <= utf8Ptm.getLength() && utf8Ptm.getLength() <= 55))
{
break;
}
ScopedVclPtrInstance<MessBox>(Application::GetDefDialogParent(),
MessBoxStyle::Ok, 0, "Password length",
"The password you have entered causes interoperability issues. Please enter a password that is shorter than 52 bytes, or longer than 55 bytes."
)->Execute();
}
while (true);
if ( pPasswordRequest->isPassword() )
{
if ( pPasswordRequest->getPassword().getLength() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment