Commit aa1140e5 authored by Michaël Zasso's avatar Michaël Zasso Committed by Rod Vagg
Browse files

buffer: SlowBuffer only accept valid numeric values

Fixes a regression that appeared with the new Buffer implementation in v3.
Without this change, calling the SlowBuffer constructor with something else
than a number would abort on the C++ side. This makes sure that the length
argument is coerced to number or is 0.

Fixes: https://github.com/nodejs/node/issues/2634
PR-URL: https://github.com/nodejs/node/pull/2635


Reviewed-By: default avatartrevnorris - Trevor Norris <trev.norris@gmail.com>
Reviewed-By: default avatarcjihrig - Colin Ihrig <cjihrig@gmail.com>
parent 2ffb21ba
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