Browse Source

Avoid ReDOS on float dynamic typing (#779)

Fixes #777
pull/790/head
Sergi Almacellas Abellana 5 years ago committed by GitHub
parent
commit
235a12758c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      papaparse.js

2
papaparse.js

@ -1006,7 +1006,7 @@ License: MIT
// One goal is to minimize the use of regular expressions... // One goal is to minimize the use of regular expressions...
var MAX_FLOAT = Math.pow(2, 53); var MAX_FLOAT = Math.pow(2, 53);
var MIN_FLOAT = -MAX_FLOAT; var MIN_FLOAT = -MAX_FLOAT;
var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i; var FLOAT = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)(e[-+]?\d+)?\s*$/;
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))/; 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))/;
var self = this; var self = this;
var _stepCounter = 0; // Number of times step was called (number of rows parsed) var _stepCounter = 0; // Number of times step was called (number of rows parsed)

Loading…
Cancel
Save