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

new Buffer is deprecated and unsafe #1885

Merged
merged 1 commit into from Sep 21, 2018
Merged

new Buffer is deprecated and unsafe #1885

merged 1 commit into from Sep 21, 2018

Conversation

ghost
Copy link

@ghost ghost commented Sep 18, 2018

What does it do?

This PR replaces all new Buffer with Buffer.from. We should not use Buffer constructor which is deprecated and unsafe.

Any helpful background information?

The behavior of new Buffer() is different depending on the type of the first argument, security and reliability issues can be inadvertently introduced into applications when argument validation or Buffer initialization is not performed.

To make the creation of Buffer instances more reliable and less error-prone, the various forms of the new Buffer() constructor have been deprecated and replaced by separate Buffer.from(), Buffer.alloc(), and Buffer.allocUnsafe() methods.

Check this out:

@beatfactor beatfactor merged commit f626363 into nightwatchjs:master Sep 21, 2018
@ghost ghost deleted the safe-buffer branch October 14, 2018 05:54
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.

1 participant