Commit 5404cbc7 authored by Trevor Norris's avatar Trevor Norris
Browse files

buffer: fix copy() segfault with zero arguments

Buffer#copy() immediately does a ToObject() on the first argument before
it checks if it's even an Object. This causes
Object::HasIndexedPropertiesInExternalArrayData() to be run on nothing,
triggering the segfault. Instead run HasInstance() on the args Value.
Which will check if it's actually an Object, before checking if it
contains data.

Fixes: https://github.com/iojs/io.js/issues/1519
PR-URL: https://github.com/iojs/io.js/pull/1520


Reviewed-by: default avatarEvan Lucas <evanlucas@me.com>
parent 2f6986ee
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment