Kaydet (Commit) 62e5c242 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

CertificateViewer: Don't crash with empty certificate path

gpg4libre

Change-Id: I4e3d59331a93c0bee98bcc493c2a6aca11005ec4
Reviewed-on: https://gerrit.libreoffice.org/34741Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 4a8b4a7b
......@@ -400,9 +400,9 @@ void CertificateViewerCertPathTP::ActivatePage()
sal_Int32 i, nCnt = aCertPath.getLength();
SvTreeListEntry* pParent = nullptr;
for( i = nCnt; i; )
for (i = nCnt-1; i >= 0; i--)
{
const Reference< security::XCertificate > rCert = pCertPath[ --i ];
const Reference< security::XCertificate > rCert = pCertPath[ i ];
OUString sName = XmlSec::GetContentPart( rCert->getSubjectName() );
//Verify the certificate
sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(rCert,
......@@ -411,7 +411,8 @@ void CertificateViewerCertPathTP::ActivatePage()
pParent = InsertCert( pParent, sName, rCert, bCertValid);
}
mpCertPathLB->Select( pParent );
if (pParent)
mpCertPathLB->Select( pParent );
mpViewCertPB->Disable(); // Own certificate selected
while( pParent )
......
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