Skip to content

Commit 40c7971

Browse files
Fabrice Bellardsaghul
authored andcommitted
added missing stack overflow check in JSON.stringify()
1 parent 3ab8ab6 commit 40c7971

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

quickjs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45373,6 +45373,11 @@ static int js_json_to_str(JSContext *ctx, JSONStringifyContext *jsc,
4537345373
tab = JS_UNDEFINED;
4537445374
prop = JS_UNDEFINED;
4537545375

45376+
if (js_check_stack_overflow(ctx->rt, 0)) {
45377+
JS_ThrowStackOverflow(ctx);
45378+
goto exception;
45379+
}
45380+
4537645381
if (JS_IsObject(val)) {
4537745382
p = JS_VALUE_GET_OBJ(val);
4537845383
cl = p->class_id;

0 commit comments

Comments
 (0)