mirror of
https://github.com/bellard/quickjs.git
synced 2025-11-15 10:12:14 +03:00
Fix length check in ArrayBuffer.prototype.slice (bnoordhuis) (#451)
This commit is contained in:
@@ -55626,7 +55626,7 @@ static JSValue js_array_buffer_slice(JSContext *ctx,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
/* must test again because of side effects */
|
/* must test again because of side effects */
|
||||||
if (abuf->detached) {
|
if (abuf->detached || abuf->byte_length < start + new_len) {
|
||||||
JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
|
JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user