Commit 873b5f84 authored by Trevor Norris's avatar Trevor Norris
Browse files

buffer: fix assert fail from JS API

Length arguments passed to SlowBuffer were coerced to Int32, not Uint32,
so passing a negative number would throw the following:

node: ../src/smalloc.cc:244: void node::smalloc::Alloc(): Assertion `length <= kMaxLength' failed.
Aborted (core dumped)

That has been fixed by coercing to Uint32 and comparing the value
against kMaxLength.
parent 16a60ed2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment