Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Check for NULL pointers for CertificateData in the GetCertificateContextPointer and...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 16 May 2016 21:17:07 +0000 (22:17 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 16 May 2016 21:17:07 +0000 (22:17 +0100)
source/carddav/carddav.cpp

index 7e73c5f..52ae03a 100644 (file)
@@ -529,6 +529,14 @@ void CardDAV::SetConnectionObject(CURL *ConnectionObjectIn){
 \r
 PCCERT_CONTEXT CardDAV::GetCertificateContextPointer(){\r
 \r
+       // Check that the PCCERT_CONTEXT has an address\r
+       // other than NULL. Return nullptr if this is the\r
+       // case.\r
+\r
+       if (CertificateData == NULL){\r
+               return NULL;\r
+       }\r
+\r
        // Get the certificate data.\r
 \r
        return CertificateData;\r
@@ -537,6 +545,15 @@ PCCERT_CONTEXT CardDAV::GetCertificateContextPointer(){
 \r
 CERT_CONTEXT CardDAV::GetCertificateContext(){\r
 \r
+       // Check that the PCCERT_CONTEXT has an address\r
+       // other than NULL. Return nullptr if this is the\r
+       // case.\r
+\r
+       if (CertificateData == NULL){\r
+               CERT_CONTEXT EmptyCertificateData = { 0 };\r
+               return EmptyCertificateData;\r
+       }\r
+\r
        // Get the certificate data.\r
 \r
        return *CertificateData;\r
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy