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



commit d075b3858100fdc5dc60cc835444f8d68b25d446
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..f445758 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 == 0 || 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 == 0 || out == NULL || outl == 0)
     return 0;
 
   gbio = (GTlsBio *)bio->ptr;


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