evas_device: Fix dereferencing null pointer

Coverity reports that 'pos' could be null here and we are potentially
dereferencing a NULL pointer, so lets add a check for 'pos' here
before trying to use it.

Fixes Coverity CID1399091

@fix

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8313
This commit is contained in:
Christopher Michael 2019-03-12 10:15:00 -04:00 committed by Marcel Hollerbach
parent 62d7d8a418
commit 5473141072
1 changed files with 4 additions and 1 deletions

View File

@ -533,7 +533,9 @@ _evas_canvas_efl_canvas_scene_pointer_position_get(const Eo *eo_e, Evas_Public_D
Eina_Iterator *it;
Eo *child;
if (pos) *pos = EINA_POSITION2D(0, 0);
if (!pos) return EINA_FALSE;
*pos = EINA_POSITION2D(0, 0);
if (!e->default_seat) return EINA_FALSE;
if (!seat)
{
@ -548,6 +550,7 @@ _evas_canvas_efl_canvas_scene_pointer_position_get(const Eo *eo_e, Evas_Public_D
break;
if (child)
*pos = efl_input_pointer_position_get(child);
eina_iterator_free(it);
return !!child;
}