Fix for null pointer dereference in jmem_heap_free_block (#2440)

Fixes #2435.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2018-08-01 16:09:30 +02:00
committed by yichoi
parent 1f20bb3fe5
commit 87897849f6
2 changed files with 20 additions and 1 deletions
@@ -553,6 +553,11 @@ ecma_builtin_typedarray_prototype_filter (ecma_value_t this_arg, /**< this argum
ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
if (len == 0)
{
return ecma_op_create_typedarray_with_type_and_length (obj_p, 0);
}
JMEM_DEFINE_LOCAL_ARRAY (pass_value_list_p, len * element_size, lit_utf8_byte_t);
lit_utf8_byte_t *pass_value_p = pass_value_list_p;
@@ -588,7 +593,6 @@ ecma_builtin_typedarray_prototype_filter (ecma_value_t this_arg, /**< this argum
ret_value = ecma_op_create_typedarray_with_type_and_length (obj_p, pass_num);
if (!ECMA_IS_VALUE_ERROR (ret_value))
{
obj_p = ecma_get_object_from_value (ret_value);