[glib-networking: 82/129] Avoid crash if the anchors file is NULL



commit 4248aba079193ae6ccf8d6d63896315dd7581d38
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Oct 29 18:54:46 2017 +0100

    Avoid crash if the anchors file is NULL
    
    This happens on Win32 if one does not ship a cert.pem file

 tls/openssl/gtlsfiledatabase-openssl.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tls/openssl/gtlsfiledatabase-openssl.c b/tls/openssl/gtlsfiledatabase-openssl.c
index 13ab7e9..10b5df7 100644
--- a/tls/openssl/gtlsfiledatabase-openssl.c
+++ b/tls/openssl/gtlsfiledatabase-openssl.c
@@ -279,6 +279,9 @@ load_certs (const gchar *file_name)
   STACK_OF(X509_INFO) *xis = NULL;
   gint i;
 
+  if (file_name == NULL)
+    return NULL;
+
   bio = BIO_new_file (file_name, "rb");
   if (bio == NULL)
     return NULL;


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