From 5d55fe0321363cc3a099ddd72b3874de81aac88b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 14 Feb 2017 15:02:30 +0900 Subject: [PATCH] evas key: Add null safety to EAPIs This avoids a crash with Bryces. This does not fix the problem with the Bryce itself. Ping @zmike See T5157 --- src/lib/evas/canvas/evas_key.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/evas/canvas/evas_key.c b/src/lib/evas/canvas/evas_key.c index 8f098e0..9b9e75b 100644 --- a/src/lib/evas/canvas/evas_key.c +++ b/src/lib/evas/canvas/evas_key.c @@ -62,6 +62,7 @@ EAPI Eina_Bool evas_seat_key_modifier_is_set(const Evas_Modifier *m, const char *keyname, const Evas_Device *seat) { + EINA_SAFETY_ON_NULL_RETURN_VAL(m, EINA_FALSE); if (!seat) seat = m->e->default_seat; EINA_SAFETY_ON_NULL_RETURN_VAL(seat, 0); @@ -73,12 +74,14 @@ evas_seat_key_modifier_is_set(const Evas_Modifier *m, const char *keyname, EAPI Eina_Bool evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname) { + EINA_SAFETY_ON_NULL_RETURN_VAL(m, EINA_FALSE); return evas_seat_key_modifier_is_set(m, keyname, NULL); } EAPI Eina_Bool evas_key_lock_is_set(const Evas_Lock *l, const char *keyname) { + EINA_SAFETY_ON_NULL_RETURN_VAL(l, EINA_FALSE); return evas_seat_key_lock_is_set(l, keyname, NULL); } @@ -86,6 +89,7 @@ EAPI Eina_Bool evas_seat_key_lock_is_set(const Evas_Lock *l, const char *keyname, const Evas_Device *seat) { + EINA_SAFETY_ON_NULL_RETURN_VAL(l, EINA_FALSE); if (!seat) seat = l->e->default_seat; EINA_SAFETY_ON_NULL_RETURN_VAL(seat, 0); -- 2.7.4