xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   20 
+++++-----
 xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx       |    2 -
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 7d936a98cd8f44e3a99f121b610b9040ae2e8381
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Oct 29 14:09:46 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Nov 1 09:57:13 2021 +0100

    Fix more misuses of NULL across Windows-only code
    
    ...that had inadvertently been missing from
    a5cea74034a8e029bfdf0f2b82ea8800bf5bd206 °Fix misuses of NULL across
    Windows-only code"
    
    Change-Id: I8f60cd6114ceb7c6413fb099778bfb06407bbb24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124431
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git 
a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx 
b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index bd1de6cbf85d..f198f839f76b 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -110,16 +110,16 @@ static void traceTrustStatus(DWORD err)
     }
 }
 
-SecurityEnvironment_MSCryptImpl::SecurityEnvironment_MSCryptImpl( const 
uno::Reference< uno::XComponentContext >& xContext ) : m_hProv( NULL ) , 
m_pszContainer( nullptr ) , m_hKeyStore( nullptr ), m_hCertStore( nullptr ), 
m_hMySystemStore(nullptr), m_hRootSystemStore(nullptr), 
m_hTrustSystemStore(nullptr), m_hCaSystemStore(nullptr), m_bEnableDefault( 
false ){
+SecurityEnvironment_MSCryptImpl::SecurityEnvironment_MSCryptImpl( const 
uno::Reference< uno::XComponentContext >& xContext ) : m_hProv( 0 ) , 
m_pszContainer( nullptr ) , m_hKeyStore( nullptr ), m_hCertStore( nullptr ), 
m_hMySystemStore(nullptr), m_hRootSystemStore(nullptr), 
m_hTrustSystemStore(nullptr), m_hCaSystemStore(nullptr), m_bEnableDefault( 
false ){
 
     m_xServiceManager.set(xContext, uno::UNO_QUERY);
 }
 
 SecurityEnvironment_MSCryptImpl::~SecurityEnvironment_MSCryptImpl() {
 
-    if( m_hProv != NULL ) {
+    if( m_hProv != 0 ) {
         CryptReleaseContext( m_hProv, 0 ) ;
-        m_hProv = NULL ;
+        m_hProv = 0 ;
     }
 
     if( m_pszContainer != nullptr ) {
@@ -181,12 +181,12 @@ HCRYPTPROV 
SecurityEnvironment_MSCryptImpl::getCryptoProvider() {
 }
 
 void SecurityEnvironment_MSCryptImpl::setCryptoProvider( HCRYPTPROV aProv ) {
-    if( m_hProv != NULL ) {
+    if( m_hProv != 0 ) {
         CryptReleaseContext( m_hProv, 0 ) ;
-        m_hProv = NULL ;
+        m_hProv = 0 ;
     }
 
-    if( aProv != NULL ) {
+    if( aProv != 0 ) {
         m_hProv = aProv ;
     }
 }
@@ -607,7 +607,7 @@ uno::Sequence< uno::Reference < XCertificate > > 
SecurityEnvironment_MSCryptImpl
             hCollectionStore = CertOpenStore(
                 CERT_STORE_PROV_COLLECTION ,
                 0 ,
-                NULL ,
+                0 ,
                 0 ,
                 nullptr
                 ) ;
@@ -722,7 +722,7 @@ uno::Reference< XCertificate > 
SecurityEnvironment_MSCryptImpl::createCertificat
 static HCERTSTORE getCertStoreForIntermediatCerts(
     const uno::Sequence< uno::Reference< css::security::XCertificate > >& 
seqCerts)
 {
-    HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, 
nullptr);
+    HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, 0, nullptr);
     if (store == nullptr)
         return nullptr;
 
@@ -764,7 +764,7 @@ static bool CheckUnitTestStore(PCCERT_CHAIN_CONTEXT const 
pChainContext, DWORD i
     static HCERTSTORE const hExtra = CertOpenStore(
             CERT_STORE_PROV_FILENAME_A,
             PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
-            NULL,
+            0,
             CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG,
             OString(OString::Concat(pVar) + "/test.p7b").getStr());
     assert(hExtra != nullptr);
@@ -844,7 +844,7 @@ sal_Int32 
SecurityEnvironment_MSCryptImpl::verifyCertificate(
         hCollectionStore = CertOpenStore(
             CERT_STORE_PROV_COLLECTION ,
             0 ,
-            NULL ,
+            0 ,
             0 ,
             nullptr
             ) ;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx 
b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
index e626beeffaaa..08143f992379 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
@@ -59,7 +59,7 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL
     {
         sCertDir = OString(sCertDB.getStr(), sCertDB.getLength(), 
RTL_TEXTENCODING_ASCII_US);
         n_pCertStore = sCertDir.getStr();
-        n_hStoreHandle = CertOpenSystemStoreW( NULL, 
o3tl::toW(sCertDB.getStr())) ;
+        n_hStoreHandle = CertOpenSystemStoreW( 0, o3tl::toW(sCertDB.getStr())) 
;
         if( n_hStoreHandle == nullptr )
         {
             return nullptr;

Reply via email to