summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-26 11:29:12 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-26 13:17:24 +0200
commit296446b87807f298b0f5663ccd42255205970864 (patch)
tree6cdcf2e21746e4fad3e091947ea7b4a07d7969fa
parentc54e7500402a638fe90912871ec6464d0346a114 (diff)
downloadefl-296446b87807f298b0f5663ccd42255205970864.tar.gz
ecore_wl2: fix null dereference issue
if we dont get the userdata of a offer something in the protocol went very very bad, we should not emit there a error, just return. Also if we are getting a null offer we should dereference the nulled out offer object. This fixes CID 1363214
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_dnd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c
index de61fdf4f7..9138c7560e 100644
--- a/src/lib/ecore_wl2/ecore_wl2_dnd.c
+++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c
@@ -226,7 +226,7 @@ _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct
if (!input->drag)
{
ERR("Userdata of offer not found");
- goto emit;
+ return;
}
input->drag->serial = serial;
@@ -245,14 +245,14 @@ _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct
input->drag = NULL;
}
-emit:
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Enter));
if (!ev) return;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
+ if (input->drag)
+ ev->win = input->drag->window_id;
- ev->win = input->drag->window_id;
ev->x = x;
ev->y = y;
ev->offer = input->drag;