Skip to content

Commit

Permalink
- fix ReDoS vulnerability (RegEx adopted from d3-color, see: d3/d3-c…
Browse files Browse the repository at this point in the history
  • Loading branch information
zbryikt committed Oct 5, 2022
1 parent 2467f0f commit d033b56
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
@@ -1,8 +1,8 @@
(function(){
var ReI, ReN, ReP, re, parse, ldcolor, t0, t1, t2, t3, Xn, Yn, Zn, conv, utils, k, v;
ReI = "\\s*([+-]?\\d+|nan|NaN)\\s*";
ReN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?|nan|NaN)\\s*";
ReP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
ReN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?|nan|NaN)\\s*";
ReP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
re = {
hex3: /^#([0-9a-fA-F]{3})$/,
hex6: /^#([0-9a-fA-F]{6})$/,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index.named.js
Expand Up @@ -151,8 +151,8 @@
yellowgreen: 0x9acd32
};
ReI = "\\s*([+-]?\\d+|nan|NaN)\\s*";
ReN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?|nan|NaN)\\s*";
ReP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
ReN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?|nan|NaN)\\s*";
ReP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
re = {
hex3: /^#([0-9a-fA-F]{3})$/,
hex6: /^#([0-9a-fA-F]{6})$/,
Expand Down

0 comments on commit d033b56

Please sign in to comment.