cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0b6e04d94fc3ff6447b6fbf0fcdbdd8b6958e621

commit 0b6e04d94fc3ff6447b6fbf0fcdbdd8b6958e621
Author: Artem Popov <artem.po...@samsung.com>
Date:   Wed Nov 16 15:30:29 2016 -0800

    eet: add NULL-check to eet_connection_empty API to avoid segfault
    
    @fix
    
    Summary:
    Only eet_connection_empty hasn't checking on NULL and try to read from 
field of object.
    Add NULL-check for connection and return result of empty connection.
    
    Reviewers: jpeg, cedric, myoungwoon
    
    Subscribers: t.naumenko, NikaWhite
    
    Differential Revision: https://phab.enlightenment.org/D4399
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/eet/eet_connection.c | 1 +
 src/lib/eet/eet_data.c       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/lib/eet/eet_connection.c b/src/lib/eet/eet_connection.c
index 7945692..735e112 100644
--- a/src/lib/eet/eet_connection.c
+++ b/src/lib/eet/eet_connection.c
@@ -157,6 +157,7 @@ _eet_connection_raw_send(Eet_Connection *conn,
 EAPI Eina_Bool
 eet_connection_empty(Eet_Connection *conn)
 {
+   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, EINA_TRUE);
    return conn->size ? EINA_FALSE : EINA_TRUE;
 }
 
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index cabafc3..d4ba25f 100644
--- a/src/lib/eet/eet_data.c
+++ b/src/lib/eet/eet_data.c
@@ -5281,6 +5281,7 @@ eet_data_descriptor_encode_cipher(Eet_Data_Descriptor 
*edd,
    int size;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(data_in, NULL);
 
    ret = _eet_data_descriptor_encode(NULL, edd, data_in, &size);
    if (cipher_key && ret)

-- 


Reply via email to