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

[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. #353

Open
Spider84 opened this issue Jan 5, 2020 · 2 comments

Comments

@Spider84
Copy link

Spider84 commented Jan 5, 2020

diff --git a/lib/memcached.js b/lib/memcached.js
index 9742a1d..2e1a94b 100644
--- a/lib/memcached.js
+++ b/lib/memcached.js
@@ -523,7 +523,7 @@ Client.config = {
           dataSet = +dataSet;
           break;
         case FLAG_BINARY:
-          tmp = new Buffer(dataSet.length);
+          tmp = Buffer.alloc(dataSet.length);
           tmp.write(dataSet, 0, 'binary');
           dataSet = tmp;
           break;
@ankon
Copy link

ankon commented Jun 17, 2020

Related to #344?

@Spider84
Copy link
Author

Yes :)

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

No branches or pull requests

2 participants