Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

new Buffer is deprecated and unsafe #341

Merged
merged 1 commit into from Sep 14, 2018
Merged

new Buffer is deprecated and unsafe #341

merged 1 commit into from Sep 14, 2018

Conversation

ghost
Copy link

@ghost ghost commented Sep 14, 2018

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

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: https://nodejs.org/api/buffer.html#buffer_buffer_from_buffer_alloc_and_buffer_allocunsafe

@ghost ghost changed the title Use Buffer.from instead of new Buffer new Buffer is deprecated and unsafe #61 Sep 14, 2018
@ghost ghost changed the title new Buffer is deprecated and unsafe #61 new Buffer is deprecated and unsafe Sep 14, 2018
@jcalfee jcalfee merged commit 6e107b4 into EOSIO:master Sep 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant