From: Shinwoo Kim Date: Tue, 10 Apr 2018 07:13:44 +0000 (+0900) Subject: efl_io_queue: add null check for slice->mem X-Git-Tag: upstream/1.21.0~1376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b60af77f54962c38aadc4088f1661d1bd74c5ec;p=platform%2Fupstream%2Fefl.git efl_io_queue: add null check for slice->mem A negative test case leads to segmentation fault. If ecore_evas_msg_parent_send is called with NULL data, then slice->mem would be NULL, and _efl_io_queue_efl_io_writer_write calls memcpy with NULL src. --- diff --git a/src/lib/efl/interfaces/efl_io_queue.c b/src/lib/efl/interfaces/efl_io_queue.c index 80bc063..d073836 100644 --- a/src/lib/efl/interfaces/efl_io_queue.c +++ b/src/lib/efl/interfaces/efl_io_queue.c @@ -375,6 +375,7 @@ _efl_io_queue_efl_io_writer_write(Eo *o, Efl_Io_Queue_Data *pd, Eina_Slice *slic int err = EINVAL; EINA_SAFETY_ON_NULL_RETURN_VAL(slice, EINVAL); + EINA_SAFETY_ON_NULL_RETURN_VAL(slice->mem, EINVAL); EINA_SAFETY_ON_TRUE_GOTO(efl_io_closer_closed_get(o), error); err = EBADF;