Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: nodejs#1519 PR-URL: nodejs#1520 Reviewed-by: Evan Lucas <[email protected]>
- Loading branch information