Skip to content

Commit 235a127

Browse files
author
Sergi Almacellas Abellana
authored
Avoid ReDOS on float dynamic typing (#779)
Fixes #777
1 parent a4cf371 commit 235a127

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

papaparse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ License: MIT
10061006
// One goal is to minimize the use of regular expressions...
10071007
var MAX_FLOAT = Math.pow(2, 53);
10081008
var MIN_FLOAT = -MAX_FLOAT;
1009-
var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
1009+
var FLOAT = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)(e[-+]?\d+)?\s*$/;
10101010
var ISO_DATE = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;
10111011
var self = this;
10121012
var _stepCounter = 0; // Number of times step was called (number of rows parsed)

0 commit comments

Comments
 (0)