File tree 1 file changed +5
-2
lines changed 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -35564,6 +35564,10 @@ static JSString *JS_ReadString(BCReaderState *s)
35564
35564
return NULL;
35565
35565
is_wide_char = len & 1;
35566
35566
len >>= 1;
35567
+ if (len > JS_STRING_LEN_MAX) {
35568
+ JS_ThrowInternalError(s->ctx, "string too long");
35569
+ return NULL;
35570
+ }
35567
35571
p = js_alloc_string(s->ctx, len, is_wide_char);
35568
35572
if (!p) {
35569
35573
s->error_state = -1;
@@ -35675,8 +35679,7 @@ static JSValue JS_ReadBigInt(BCReaderState *s)
35675
35679
bc_read_trace(s, "}\n");
35676
35680
return __JS_NewShortBigInt(s->ctx, 0);
35677
35681
}
35678
- p = js_bigint_new(s->ctx,
35679
- (len + (JS_LIMB_BITS / 8) - 1) / (JS_LIMB_BITS / 8));
35682
+ p = js_bigint_new(s->ctx, (len - 1) / (JS_LIMB_BITS / 8) + 1);
35680
35683
if (!p)
35681
35684
goto fail;
35682
35685
for(i = 0; i < len / (JS_LIMB_BITS / 8); i++) {
You can’t perform that action at this time.
0 commit comments