buffer: harden SlowBuffer creation

PR-URL: https://github.com/nodejs/node/pull/26272
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
ZYSzys authored and Daniel Bevenius committed 2019-03-11 09:46:29 +01:00
1 parent 560466c773
commit 6113ba96cb
2 files changed
+15 -14

No files matched your search

-2
View File
@@ -297,8 +297,6 @@ Buffer.allocUnsafeSlow = function allocUnsafeSlow(size) {
// If --zero-fill-buffers command line argument is set, a zero-filled
// buffer is returned.
function SlowBuffer(length) {
if (typeof length !== 'number')
length = +length;
assertSize(length);
return createUnsafeBuffer(length);
}