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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Oct 20 17:52:14 UTC 2018


 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 71c804a05eb07fa21482ca298486ed70c63907ad
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 19 16:10:45 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 20 19:51:53 2018 +0200

    pvs-studio: The 'store' variable is assigned values twice successively.
    
    Change-Id: I532bf99935c2f4d3b58f666684013bc545791208
    Reviewed-on: https://gerrit.libreoffice.org/62050
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 5e6dfcb93a99..4ba5ad8a4417 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -735,14 +735,12 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificat
 }
 
 uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificateFromAscii( const OUString& asciiCertificate ) {
-    xmlChar* chCert ;
-    xmlSecSize certSize ;
 
     OString oscert = OUStringToOString( asciiCertificate , RTL_TEXTENCODING_ASCII_US ) ;
 
-    chCert = xmlStrndup( reinterpret_cast<const xmlChar*>(oscert.getStr()), static_cast<int>(oscert.getLength()) ) ;
+    xmlChar* chCert = xmlStrndup( reinterpret_cast<const xmlChar*>(oscert.getStr()), static_cast<int>(oscert.getLength()) ) ;
 
-    certSize = xmlSecBase64Decode( chCert, chCert, xmlStrlen( chCert ) ) ;
+    xmlSecSize certSize = xmlSecBase64Decode( chCert, chCert, xmlStrlen( chCert ) ) ;
 
     uno::Sequence< sal_Int8 > rawCert( certSize ) ;
     for( xmlSecSize i = 0 ; i < certSize ; i ++ )
@@ -757,9 +755,7 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificat
 static HCERTSTORE getCertStoreForIntermediatCerts(
     const uno::Sequence< uno::Reference< css::security::XCertificate > >& seqCerts)
 {
-    HCERTSTORE store = nullptr;
-    store = CertOpenStore(
-        CERT_STORE_PROV_MEMORY, 0, NULL, 0, nullptr);
+    HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, nullptr);
     if (store == nullptr)
         return nullptr;
 


More information about the Libreoffice-commits mailing list