Skip to content

Commit

Permalink
Fix ReDos in CSS_RGB and CSS_RGBA
Browse files Browse the repository at this point in the history
  • Loading branch information
yetingli authored Oct 6, 2020
1 parent 51d1a37 commit 1e1aecb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dat/color/interpret.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const INTERPRETATIONS = [

CSS_RGB: {
read: function(original) {
const test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
const test = original.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
if (test === null) {
return false;
}
Expand All @@ -76,7 +76,7 @@ const INTERPRETATIONS = [

CSS_RGBA: {
read: function(original) {
const test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
const test = original.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
if (test === null) {
return false;
}
Expand Down

0 comments on commit 1e1aecb

Please sign in to comment.