diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 78d6aa45590..687545a2052 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -404,7 +404,7 @@ Handle ReadFloatGeneric(const Arguments& args) { return ThrowTypeError("offset is not uint"); size_t len = static_cast( args.This()->GetIndexedPropertiesExternalArrayDataLength()); - if (offset + sizeof(T) > len) + if (offset + sizeof(T) > len || offset + sizeof(T) < offset) return ThrowRangeError("Trying to read beyond buffer length"); }