Commit Graph

15 Commits

Author SHA1 Message Date
tidwall 4c9fc61b49 Add MatchLimit function for limiting pattern complexity
This commit adds the MatchLimit function, which it the
same as Match but will limit the complexity of the input pattern.
This is to avoid long running matches, specifically to avoid ReDos
attacks from arbritary inputs.

How it works:
The underlying match routine is recursive and may call itself when it
encounters a sandwiched wildcard pattern, such as: `user:*:name`.
Everytime it calls itself a counter is incremented.
The operation is stopped when counter > maxcomp*len(str).
2021-10-08 07:36:13 -07:00
tidwall 84b6aacbb9 Avoid expensive recursive operations 2021-10-04 11:40:34 -07:00
tidwall c2f534168b Fix slowness with repetitive stars 2020-12-23 04:58:28 -07:00
tidwall 82db0acde1 Added go.mod 2020-12-23 04:57:38 -07:00
tidwall 9e52e9e068 fix comments 2020-11-03 10:51:01 -07:00
tidwall b24a38d77b Merge branch 'master' of https://github.com/tidwall/match 2020-11-03 10:50:31 -07:00
tidwall 1f62957036 Fix rune error 2020-11-03 10:50:25 -07:00
Josh Baker b6b9b017b4
Update README.md 2020-11-03 10:48:15 -07:00
Josh Baker 91375a2901
Create go.yml 2020-11-03 10:47:51 -07:00
Josh Baker 8ca0ca4f07
Delete .travis.yml 2020-11-03 10:47:42 -07:00
Josh Baker 3501043945
Update README.md 2020-11-03 10:47:25 -07:00
tidwall 33827db735 Added IsPattern func 2018-12-10 03:08:38 -07:00
Josh Baker 1731857f09 Fix formatting 2017-10-02 00:59:45 -07:00
Josh Baker 173748da73 allowable ranges 2016-08-30 10:39:30 -07:00
Josh Baker 970f69b4db first commit 2016-08-30 07:19:45 -07:00