Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: using Buffer.alloc(size) instead of new Buffer(size) #34

Merged
merged 1 commit into from
May 15, 2018

Conversation

gxcsoccer
Copy link
Member

new Buffer(size) 没有 fill 0,可能会导致信息泄露。并且 node 10 里已经 deprecated,用 Buffer.alloc / Buffer.from / Buffer.allocUnsafe 代替

https://snyk.io/vuln/npm:byte:20180512

lib/byte.js Outdated
@@ -21,7 +21,7 @@ function ByteBuffer(options) {
if (array) {
this._bytes = array;
} else {
this._bytes = new Buffer(this._size);
this._bytes = Buffer.alloc(this._size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node 4 不支持,需要兼容一下

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我还专门查了的,把 10.0.0 看成 0.10.0 了,但是 ci 里 4 是过了的

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gxcsoccer gxcsoccer merged commit ccc6f4b into master May 15, 2018
@gxcsoccer gxcsoccer deleted the fix-new-buffer branch May 15, 2018 03:11
@gxcsoccer
Copy link
Member Author

1.4.1

ChALkeR added a commit to ChALkeR/security-wg that referenced this pull request May 15, 2018
vdeturckheim pushed a commit to nodejs/security-wg that referenced this pull request May 15, 2018
patrickm68 added a commit to patrickm68/security-wg-process that referenced this pull request Sep 14, 2023
mattstern31 added a commit to mattstern31/security-wg-process that referenced this pull request Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants