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 PR-URL: https://github.com/nodejs/node/pull/7051 Reviewed-By:Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By:
Trevor Norris <trev.norris@gmail.com> Reviewed-By:
Rod Vagg <rod@vagg.org>
parent
0cc90354
Please register or sign in to comment