Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43887,7 +43887,7 @@ static JSValue js_string_pad(JSContext *ctx, JSValueConst this_val,
}
if (n > JS_STRING_LEN_MAX) {
JS_ThrowRangeError(ctx, "invalid string length");
goto fail2;
goto fail3;
}
if (string_buffer_init(ctx, b, n))
goto fail3;
Expand Down
5 changes: 5 additions & 0 deletions tests/str-pad-leak.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var v1 = '';
try {
var v2 = v1.padEnd(2147483620, 0);
} catch(_) {}