Skip to content

Commit caae298

Browse files
karenyavineleo
authored andcommitted
Limit str to 100 to avoid ReDoS of 0.3s (#89)
1 parent b83b36d commit caae298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = function(val, options) {
4646

4747
function parse(str) {
4848
str = String(str);
49-
if (str.length > 10000) {
49+
if (str.length > 100) {
5050
return;
5151
}
5252
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(

0 commit comments

Comments
 (0)