mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
[ruby/time] Fix quadratic backtracking on invalid time
https://hackerone.com/reports/1485501
2444456fc1
This commit is contained in:
parent
623027bf0b
commit
aa3885501f
1 changed files with 2 additions and 2 deletions
|
@ -509,8 +509,8 @@ class Time
|
|||
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
|
||||
(\d{2,})\s+
|
||||
(\d{2})\s*
|
||||
:\s*(\d{2})\s*
|
||||
(?::\s*(\d{2}))?\s+
|
||||
:\s*(\d{2})
|
||||
(?:\s*:\s*(\d{2}))?\s+
|
||||
([+-]\d{4}|
|
||||
UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-IK-Z])/ix =~ date
|
||||
# Since RFC 2822 permit comments, the regexp has no right anchor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue