Fix heap-buffer-overflow in ecma_collection_append (#3645)

This patch fixes #3628.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-03-27 11:28:36 +01:00
committed by GitHub
parent 2ed742a9e7
commit 3c7a776cae
2 changed files with 26 additions and 1 deletions
@@ -174,7 +174,7 @@ ecma_collection_append (ecma_collection_t *collection_p, /**< value collection *
uint32_t count) /**< number of ecma values to append */
{
JERRY_ASSERT (collection_p != NULL);
if (collection_p->capacity - collection_p->item_count > count)
if (collection_p->capacity - collection_p->item_count >= count)
{
ecma_collection_reserve (collection_p, count);
}