Unverified Commit 69a68c0b authored by Anna Henningsen's avatar Anna Henningsen
Browse files

buffer: zero-fill buffer allocated with invalid content

Zero-fill when `Buffer.alloc()` receives invalid fill data.

A solution like https://github.com/nodejs/node/pull/17427 which switches
to throwing makes sense, but is likely a breaking change.

This suggestion leaves the behaviour of `buffer.fill()` untouched,
since any change to it would be a breaking change, and lets
`Buffer.alloc()` check whether any filling took place or not.

PR-URL: https://github.com/nodejs/node/pull/17428
Refs: https://github.com/nodejs/node/pull/17427
Refs: https://github.com/nodejs/node/issues/17423


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarAnatoli Papirovski <apapirovski@mac.com>
Reviewed-By: default avatarAli Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: default avatarTobias Nießen <tniessen@tnie.de>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
parent b31626ef
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