Commit d2dc234d authored by Michaël Zasso's avatar Michaël Zasso
Browse files

buffer: validate list elements in Buffer.concat

Without this change, if any of the elements in the list to be concatenated is
not a Buffer instance, the method fails with "buf.copy is not a function".
Make an isBuffer check before using the copy method so that we can throw with
a better message.

Fixes: https://github.com/nodejs/node/issues/4949
PR-URL: https://github.com/nodejs/node/pull/4951


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarSakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: default avatarRoman Klauke <romaaan.git@gmail.com>
parent de3e94b0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment