diff --git a/quickjs.c b/quickjs.c index b4020d0..fcc7368 100644 --- a/quickjs.c +++ b/quickjs.c @@ -55626,7 +55626,7 @@ static JSValue js_array_buffer_slice(JSContext *ctx, goto fail; } /* must test again because of side effects */ - if (abuf->detached) { + if (abuf->detached || abuf->byte_length < start + new_len) { JS_ThrowTypeErrorDetachedArrayBuffer(ctx); goto fail; }