cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6fedf6819a1c6aa9b7bfb205a591788fa3cbd7a3

commit 6fedf6819a1c6aa9b7bfb205a591788fa3cbd7a3
Author: Srivardhan Hebbar <sri.heb...@samsung.com>
Date:   Wed Feb 4 14:09:24 2015 +0100

    Ecore_con: preventing _init_con_ssl_init_count to go below zero.
    
    Summary: _init_con_ssl_init_count should not go below zero. This can occur 
if a developer mistakenly calls ssl shutdown before calling ssl init. So adding 
the check to prevent this.
    
    Reviewers: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1925
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/ecore_con/ecore_con_ssl.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/ecore_con/ecore_con_ssl.c 
b/src/lib/ecore_con/ecore_con_ssl.c
index 3ae0560..04833f7 100644
--- a/src/lib/ecore_con/ecore_con_ssl.c
+++ b/src/lib/ecore_con/ecore_con_ssl.c
@@ -470,6 +470,13 @@ ecore_con_ssl_init(void)
 Ecore_Con_Ssl_Error
 ecore_con_ssl_shutdown(void)
 {
+   /* _init_con_ssl_init_count should not go below zero. */
+   if (_init_con_ssl_init_count < 1)
+     {
+        ERR("ecore_con_ssl_shutdown called without calling 
ecore_con_ssl_init.\n");
+        return 0;
+     }
+
    if (!--_init_con_ssl_init_count)
      SSL_SUFFIX(_ecore_con_ssl_shutdown) ();
 

-- 


Reply via email to