summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2018-02-06 17:58:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2018-02-06 17:58:44 +0900
commit24b0ae0df5c6dc3f8de2f8a3144132d57deeef32 (patch)
tree1f5ac674c013de17047897bcab2d3fbee9379748
parent1accec4ce1d75087222219f5e8a50909860a2089 (diff)
ecore/evas: add NULL checks to handle argument is NULL.
Summary: ecore_pipe_read_fd/ecore_pipe_write_fd evas_engine_info_set/get Reviewers: woohyun, Jaehyun, Jaehyun_Cho, jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5790
-rw-r--r--src/lib/ecore/ecore_pipe.c2
-rw-r--r--src/lib/evas/canvas/evas_main.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c
index f26f6bd25d..06b732b500 100644
--- a/src/lib/ecore/ecore_pipe.c
+++ b/src/lib/ecore/ecore_pipe.c
@@ -140,6 +140,7 @@ EAPI int
140ecore_pipe_read_fd(Ecore_Pipe *p) 140ecore_pipe_read_fd(Ecore_Pipe *p)
141{ 141{
142 EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID); 142 EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID);
143 if (!p) return PIPE_FD_INVALID;
143 return p->fd_read; 144 return p->fd_read;
144} 145}
145 146
@@ -201,6 +202,7 @@ EAPI int
201ecore_pipe_write_fd(Ecore_Pipe *p) 202ecore_pipe_write_fd(Ecore_Pipe *p)
202{ 203{
203 EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID); 204 EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID);
205 if (!p) return PIPE_FD_INVALID;
204 return p->fd_write; 206 return p->fd_write;
205} 207}
206 208
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 472dc03cdb..e98577a714 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -468,6 +468,8 @@ next_zombie:
468EAPI Evas_Engine_Info * 468EAPI Evas_Engine_Info *
469evas_engine_info_get(const Evas *obj) 469evas_engine_info_get(const Evas *obj)
470{ 470{
471 if (!obj) return NULL;
472
471 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS); 473 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
472 Efl_Canvas_Output *output; 474 Efl_Canvas_Output *output;
473 475
@@ -485,6 +487,8 @@ evas_engine_info_get(const Evas *obj)
485EAPI Eina_Bool 487EAPI Eina_Bool
486evas_engine_info_set(Evas *obj, Evas_Engine_Info *info) 488evas_engine_info_set(Evas *obj, Evas_Engine_Info *info)
487{ 489{
490 if (!obj) return EINA_FALSE;
491
488 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS); 492 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
489 Efl_Canvas_Output *output; 493 Efl_Canvas_Output *output;
490 494