Commit 27785aeb authored by Anna Henningsen's avatar Anna Henningsen Committed by Сковорода Никита Андреевич
Browse files

buffer: ignore negative allocation lengths

Treat negative length arguments to `Buffer()`/`allocUnsafe()`
as if they were zero so the allocation does not affect the
pool’s offset.

Fixes: https://github.com/nodejs/node/issues/7047

Refs: https://github.com/nodejs/node/pull/7051
PR-URL: https://github.com/nodejs/node/pull/7221


Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 21552bd0
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