Prevent stack-overflow in json internalize property (#4877)

This patch fixes #4848.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
Robert Fancsik
2021-12-15 11:34:22 +01:00
committed by GitHub
parent 070096f30f
commit dfc001d373
3 changed files with 37 additions and 2 deletions
@@ -26,6 +26,7 @@
#include "ecma-objects-general.h"
#include "ecma-objects.h"
#include "jcontext.h"
#include "jrt-libc-includes.h"
#include "jrt.h"
#include "lit-char-helpers.h"
@@ -635,6 +636,8 @@ ecma_builtin_json_internalize_property (ecma_object_t *reviver_p, /**< reviver f
JERRY_ASSERT (holder_p);
JERRY_ASSERT (name_p);
ECMA_CHECK_STACK_USAGE ();
/* 1. */
ecma_value_t value = ecma_op_object_get (holder_p, name_p);