raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=ebd903e08b5c0a925951920629aa2f3981cf6583
commit ebd903e08b5c0a925951920629aa2f3981cf6583 Author: Mike Blumenkrantz <[email protected]> Date: Mon Jan 22 17:34:20 2018 -0500 ecore-x: add more null checks for functions @fix --- src/lib/ecore_x/ecore_x.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c index bcd1f7ad7c..3fcf0ec279 100644 --- a/src/lib/ecore_x/ecore_x.c +++ b/src/lib/ecore_x/ecore_x.c @@ -979,7 +979,7 @@ ecore_x_screen_size_get(const Ecore_X_Screen *screen, LOGFN(__FILE__, __LINE__, __FUNCTION__); if (w) *w = 0; if (h) *h = 0; - if (!s) return; + EINA_SAFETY_ON_NULL_RETURN(screen); if (w) *w = s->width; if (h) *h = s->height; } @@ -1012,6 +1012,7 @@ ecore_x_screen_count_get(void) EAPI int ecore_x_screen_index_get(const Ecore_X_Screen *screen) { + EINA_SAFETY_ON_NULL_RETURN_VAL(screen, -1); return XScreenNumberOfScreen((Screen *)screen); } @@ -1866,6 +1867,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, int mod, int any_mod) { + EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); _ecore_x_window_button_ungrab_internal(win, button, mod, any_mod); _ecore_x_sync_magic_send(1, win, button, mod, any_mod); // _ecore_x_window_grab_remove(win, button, mod, any_mod); @@ -1970,6 +1972,7 @@ ecore_x_window_key_grab(Ecore_X_Window win, { Keygrab *t; + EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); _ecore_x_window_key_grab_internal(win, key, mod, any_mod); _ecore_key_grabs_num++; t = realloc(_ecore_key_grabs, @@ -2076,6 +2079,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, int mod, int any_mod) { + EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); _ecore_x_window_key_ungrab_internal(win, key, mod, any_mod); _ecore_x_sync_magic_send(2, win, XStringToKeysym(key), mod, any_mod); // _ecore_x_key_grab_remove(win, key, mod, any_mod); --
