buffer: check data is not null
Because it's possible for the data within a Buffer instance to be altered after instantiation, or in case a user attempts to do something like the following: Buffer.prototype.fill.call({}, 10, 0, 10); It doesn't result in a segfault.
This commit is contained in:
parent
66b8c3c5a0
commit
fe0bf6b7ac
@ -43,7 +43,9 @@
|
||||
Local<Object> obj = argT; \
|
||||
size_t obj_length = obj->GetIndexedPropertiesExternalArrayDataLength(); \
|
||||
char* obj_data = static_cast<char*>( \
|
||||
obj->GetIndexedPropertiesExternalArrayData());
|
||||
obj->GetIndexedPropertiesExternalArrayData()); \
|
||||
if (obj_length > 0) \
|
||||
assert(obj_data != NULL);
|
||||
|
||||
#define SLICE_START_END(start_arg, end_arg, end_max) \
|
||||
size_t start; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user