mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 850873 - Fix null-checking in JS_NewArrayBufferWithContents. r=Waldo
This commit is contained in:
parent
e40b21d88c
commit
fb57c0fab7
@ -3725,9 +3725,10 @@ JS_NewArrayBuffer(JSContext *cx, uint32_t nbytes)
|
||||
JS_PUBLIC_API(JSObject *)
|
||||
JS_NewArrayBufferWithContents(JSContext *cx, void *contents)
|
||||
{
|
||||
if (!contents)
|
||||
return NULL;
|
||||
JS_ASSERT(contents);
|
||||
JSObject *obj = ArrayBufferObject::create(cx, 0);
|
||||
if (!obj)
|
||||
return NULL;
|
||||
obj->setDynamicElements(reinterpret_cast<js::ObjectElements *>(contents));
|
||||
JS_ASSERT(*GetViewList(&obj->asArrayBuffer()) == NULL);
|
||||
return obj;
|
||||
|
Loading…
Reference in New Issue
Block a user