summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-02-04 14:09:24 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-04 14:09:38 +0100
commit6fedf6819a1c6aa9b7bfb205a591788fa3cbd7a3 (patch)
tree3671f3041c2118eabb4aaf6f5b8795cb4add4b4c
parent7143bd7fb5196f97003216528bfbfb8bec4826bd (diff)
downloadefl-6fedf6819a1c6aa9b7bfb205a591788fa3cbd7a3.tar.gz
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 <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_con/ecore_con_ssl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c
index 3ae056019a..04833f7117 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) ();