mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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:
1 parent
560466c773
commit
6113ba96cb
2 files changed
+15
-14
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user