This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch v-1.26.0
in repository efl.
View the commit online.
commit 43c6562a4d33c823b0cc03b649be5ba50e372e1a
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Sat Mar 26 23:03:20 2022 +0000
elm - be more robust in the face of null cnp obj and bad app code
someone decided passing a null obj to elm_cnp_selection_set from an app
is a good idea. it's not... but let's not crash 9nside efl if someone
does and instead survive and complain
@fix
---
src/lib/elementary/efl_ui_win.c | 1 +
src/lib/elementary/elm_cnp.c | 14 ++++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index d261d39953..e320795d5f 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -9226,6 +9226,7 @@ _ui_buffer_get(Ecore_Evas_Selection_Buffer buffer)
void
_register_selection_changed(Efl_Ui_Selection *selection)
{
+ if (!selection) return;
ELM_WIN_DATA_GET(efl_provider_find(selection, EFL_UI_WIN_CLASS), pd);
eina_array_push(pd->planned_changes, selection);
diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c
index ded6e10503..2c6578ef82 100644
--- a/src/lib/elementary/elm_cnp.c
+++ b/src/lib/elementary/elm_cnp.c
@@ -127,6 +127,18 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
Eina_Array *tmp;
unsigned char *mem_buf = NULL;
+ if (!obj)
+ {
+ ERR("elm_cnp_selection_set() passed NULL object");
+ return EINA_FALSE;
+ }
+ ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee)
+ {
+ ERR("elm_cnp_selection_set() can't fine ecore_evas for obj %p", obj);
+ return EINA_FALSE;
+ }
+
if (format == ELM_SEL_FORMAT_TEXT && ((char*)buf)[buflen - 1] != '\0')
{
mem_buf = eina_memdup((unsigned char *)buf, buflen, EINA_TRUE);
@@ -139,8 +151,6 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
data.len = buflen;
}
- ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
-
if (format == ELM_SEL_FORMAT_IMAGE)
{
tmp = _elm_sel_from_content_to_mime_type(buf, buflen);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.