[geary/mjog/991-gcr-critical: 1/2] Application.CertificateManager: Fix critical when no GCR trust stores




commit 7f7c55e79a0ec40ec3fae5c86568e4c1b6cc37df
Author: Michael Gratton <mike vee net>
Date:   Fri Sep 25 08:25:34 2020 +1000

    Application.CertificateManager: Fix critical when no GCR trust stores
    
    Ensure GCR store not null before accessing it.

 src/client/application/application-certificate-manager.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/client/application/application-certificate-manager.vala 
b/src/client/application/application-certificate-manager.vala
index ff0e7785a..d9e40fcd0 100644
--- a/src/client/application/application-certificate-manager.vala
+++ b/src/client/application/application-certificate-manager.vala
@@ -74,8 +74,10 @@ public class Application.CertificateManager : GLib.Object {
         bool has_rw_store = false;
         if (has_uris) {
             Gck.Slot? store = Gcr.pkcs11_get_trust_store_slot();
-            has_rw_store = !store.has_flags(CKF_WRITE_PROTECTED);
-            debug("GCR store is R/W: %s", has_rw_store.to_string());
+            if (store != null) {
+                has_rw_store = !store.has_flags(CKF_WRITE_PROTECTED);
+                debug("GCR store is R/W: %s", has_rw_store.to_string());
+            }
         }
 
         return has_rw_store;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]