Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
src: Check for overflow when extending AliasedBufferBase
When resizing an aliased_buffer check if the new size will overflow.
  • Loading branch information
amdoku committed Feb 14, 2020
commit fac0992c285686dd51ab37478d031674003972c1
3 changes: 2 additions & 1 deletion src/aliased_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down