diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-19 16:10:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-20 19:51:53 +0200 |
commit | 71c804a05eb07fa21482ca298486ed70c63907ad (patch) | |
tree | 3f16cdab64e0d2171e0781abd15f6f98da06d5bf /xmlsecurity | |
parent | fc6dd83ba24a9fed9c61caddfba701d6835bc80c (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
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; |