mirror of https://github.com/nodejs/node.git
src: check for overflow when extending AliasedBufferBase
When resizing an aliased_buffer check if the new size will overflow. PR-URL: https://github.com/nodejs/node/pull/31740 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>pull/32563/head
parent
575b4e368d
commit
8245a7816c
|
@ -221,7 +221,8 @@ class AliasedBufferBase {
|
|||
const v8::HandleScope handle_scope(isolate_);
|
||||
|
||||
const size_t old_size_in_bytes = sizeof(NativeT) * count_;
|
||||
const size_t new_size_in_bytes = sizeof(NativeT) * new_capacity;
|
||||
const size_t new_size_in_bytes = MultiplyWithOverflowCheck(sizeof(NativeT),
|
||||
new_capacity);
|
||||
|
||||
// allocate v8 new ArrayBuffer
|
||||
v8::Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(
|
||||
|
|
Loading…
Reference in New Issue