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

Commit b85f78a3 by Mick Hansen

fix: regression with blob array values from 3.17.2

1 parent e67a9b3f
Showing with 8 additions and 1 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,7 +578,11 @@ BLOB.prototype.validate = function(value) {
BLOB.prototype.escape = false;
BLOB.prototype.$stringify = function (value) {
if (!Buffer.isBuffer(value)) {
value = new Buffer(value.toString());
if (Array.isArray(value)) {
value = new Buffer(value);
} else {
value = new Buffer(value.toString());
}
}
var hex = value.toString('hex');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!