[ruby/time] Make RFC2822 regexp linear

https://hackerone.com/reports/1485501

https://github.com/ruby/time/commit/51034bda4c
This commit is contained in:
Nobuyoshi Nakada 2022-12-30 14:32:05 +09:00 committed by git
parent aa3885501f
commit cbfd029985

View File

@ -510,7 +510,7 @@ class Time
(\d{2,})\s+
(\d{2})\s*
:\s*(\d{2})
(?:\s*:\s*(\d{2}))?\s+
(?:\s*:\s*(\d\d))?\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.