Skip to content

Commit

Permalink
remove ReDoS regexp in %o formatter (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuangya authored and TooTallNate committed Sep 21, 2017
1 parent 47747f3 commit c38a016
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ function useColors() {
exports.formatters.o = function(v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts)
.replace(/\s*\n\s*/g, ' ');
.split('\n').map(function(str) {
return str.trim()
}).join(' ');
};

/**
Expand Down

0 comments on commit c38a016

Please sign in to comment.