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
This commit is contained in:
Marcel Hollerbach 2016-09-26 11:29:12 +02:00
parent c54e750040
commit 296446b878
1 changed files with 3 additions and 3 deletions

View File

@ -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;