From 2ee240ea1692bf857db6210fdc26723ede98b54e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 25 May 2016 13:49:19 -0700 Subject: [PATCH] Fix low-risk uninitialized memory buffer issue --- client.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 9394244..5c7b960 100644 --- a/client.js +++ b/client.js @@ -155,8 +155,10 @@ Client.scrape = function (opts, cb) { }) opts.infoHash = Array.isArray(opts.infoHash) - ? opts.infoHash.map(function (infoHash) { return new Buffer(infoHash, 'hex') }) - : new Buffer(opts.infoHash, 'hex') + ? opts.infoHash.map(function (infoHash) { + return new Buffer(String(infoHash), 'hex') + }) + : new Buffer(String(opts.infoHash), 'hex') client.scrape({ infoHash: opts.infoHash }) return client }