summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 13:04:20 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 13:35:07 -0300
commit2457d6f5951e169749a2d941ea0ddc36e51fef99 (patch)
tree1317e88f1764d4b94f995f34f9e26a8bbd59970e /src
parent3ffe38b0c33bf7ff611098df2a8a9c16f696eb17 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_promise.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c
index 6f83172e10..824a7df8f1 100644
--- a/src/lib/eina/eina_promise.c
+++ b/src/lib/eina/eina_promise.c
@@ -772,7 +772,7 @@ eina_promise_race(Eina_Iterator* it)
772 num_promises = eina_array_count_get(promises); 772 num_promises = eina_array_count_get(promises);
773 promise = (_Eina_Promise_Default_Owner*) 773 promise = (_Eina_Promise_Default_Owner*)
774 eina_promise_default_add(sizeof(_Eina_Promise_Race_Value_Type) + 774 eina_promise_default_add(sizeof(_Eina_Promise_Race_Value_Type) +
775 sizeof(struct _Eina_Promise_Race_Information*)*num_promises); 775 sizeof(struct _Eina_Promise_Race_Information)*num_promises);
776 value = eina_promise_owner_buffer_get((Eina_Promise_Owner*)promise); 776 value = eina_promise_owner_buffer_get((Eina_Promise_Owner*)promise);
777 value->value = NULL; 777 value->value = NULL;
778 value->promise_index = -1; 778 value->promise_index = -1;