[glib-networking/wip/openssl] Ensure bio is inited before using it



commit 9000236b9228561baea3f2ba051db2388c3fbd25
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Nov 9 12:26:47 2015 +0100

    Ensure bio is inited before using it

 tls/openssl/gtlsbio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tls/openssl/gtlsbio.c b/tls/openssl/gtlsbio.c
index 24dd48f..d91a5c2 100644
--- a/tls/openssl/gtlsbio.c
+++ b/tls/openssl/gtlsbio.c
@@ -112,7 +112,7 @@ gtls_bio_write (BIO        *bio,
 {
   GTlsBio *gbio;
 
-  if (in == NULL || inl == 0)
+  if (!bio->init || in == NULL || inl == 0)
     return 0;
 
   gbio = (GTlsBio *)bio->ptr;
@@ -131,7 +131,7 @@ gtls_bio_read (BIO  *bio,
 {
   GTlsBio *gbio;
 
-  if (out == NULL || outl == 0)
+  if (!bio->init || out == NULL || outl == 0)
     return 0;
 
   gbio = (GTlsBio *)bio->ptr;


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