eina: Fix crashing when accessing past-the-end of the malloc'ed promise

The promise race composition was calculating its size wrongly, making
the promise's size smaller than it should, causing heap corruption.
This commit is contained in:
Felipe Magno de Almeida 2016-05-26 13:04:20 -03:00
parent 3ffe38b0c3
commit 2457d6f595
1 changed files with 1 additions and 1 deletions

View File

@ -772,7 +772,7 @@ eina_promise_race(Eina_Iterator* it)
num_promises = eina_array_count_get(promises);
promise = (_Eina_Promise_Default_Owner*)
eina_promise_default_add(sizeof(_Eina_Promise_Race_Value_Type) +
sizeof(struct _Eina_Promise_Race_Information*)*num_promises);
sizeof(struct _Eina_Promise_Race_Information)*num_promises);
value = eina_promise_owner_buffer_get((Eina_Promise_Owner*)promise);
value->value = NULL;
value->promise_index = -1;