不要怂,就是干,撸起袖子干!

Commit b85f78a3 by Mick Hansen

fix: regression with blob array values from 3.17.2

1 parent e67a9b3f
Showing with 7 additions and 0 deletions
# 3.17.3
- [FIXED] Regression with array values from security fix in 3.17.2
# 3.17.2
- [SECURITY] Force non-buffer blob values to string, https://github.com/nodejs/node/issues/4660
......
......@@ -578,8 +578,12 @@ BLOB.prototype.validate = function(value) {
BLOB.prototype.escape = false;
BLOB.prototype.$stringify = function (value) {
if (!Buffer.isBuffer(value)) {
if (Array.isArray(value)) {
value = new Buffer(value);
} else {
value = new Buffer(value.toString());
}
}
var hex = value.toString('hex');
return this.$hexify(hex);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!