Skip to content

Commit c6fe5a9

Browse files
author
Fabrice Bellard
committed
Fix length check in ArrayBuffer.prototype.slice (bnoordhuis) (#451)
1 parent 7cfddd0 commit c6fe5a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quickjs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55626,7 +55626,7 @@ static JSValue js_array_buffer_slice(JSContext *ctx,
5562655626
goto fail;
5562755627
}
5562855628
/* must test again because of side effects */
55629-
if (abuf->detached) {
55629+
if (abuf->detached || abuf->byte_length < start + new_len) {
5563055630
JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
5563155631
goto fail;
5563255632
}

0 commit comments

Comments
 (0)