summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorArtem Popov <artem.popov@samsung.com>2016-11-16 15:30:29 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-11-16 15:30:44 -0800
commit0b6e04d94fc3ff6447b6fbf0fcdbdd8b6958e621 (patch)
tree53b18bb8cda9b7390f382848dca703e88c286360 /src/lib/eet
parent417871e19b0a278bf23adc6c3497c2ed3da17836 (diff)
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 <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_connection.c1
-rw-r--r--src/lib/eet/eet_data.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/eet/eet_connection.c b/src/lib/eet/eet_connection.c
index 7945692aaa..735e112271 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,
157EAPI Eina_Bool 157EAPI Eina_Bool
158eet_connection_empty(Eet_Connection *conn) 158eet_connection_empty(Eet_Connection *conn)
159{ 159{
160 EINA_SAFETY_ON_NULL_RETURN_VAL(conn, EINA_TRUE);
160 return conn->size ? EINA_FALSE : EINA_TRUE; 161 return conn->size ? EINA_FALSE : EINA_TRUE;
161} 162}
162 163
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index cabafc37a6..d4ba25f0eb 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,
5281 int size; 5281 int size;
5282 5282
5283 EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL); 5283 EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL);
5284 EINA_SAFETY_ON_NULL_RETURN_VAL(data_in, NULL);
5284 5285
5285 ret = _eet_data_descriptor_encode(NULL, edd, data_in, &size); 5286 ret = _eet_data_descriptor_encode(NULL, edd, data_in, &size);
5286 if (cipher_key && ret) 5287 if (cipher_key && ret)