[PATCH] Add length limit option for methods that parses date strings
authorYusuke Endoh <mame@ruby-lang.org>
Fri, 12 Nov 2021 03:15:25 +0000 (12:15 +0900)
committerUtkarsh Gupta <utkarsh@debian.org>
Sun, 5 Dec 2021 23:55:44 +0000 (23:55 +0000)
commit608f46e05092f461031675ffe3b0cba8220e83b8
treed8313cf8f26ab3660ed54ab1e8fba652c60f0fba
parent5a8fab7753d8cea75d0ccbf49069639a8805ac8e
[PATCH] Add length limit option for methods that parses date strings

`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.

Not only `Date.parse` but also the following methods are changed.

* Date._parse
* Date.parse
* DateTime.parse
* Date._iso8601
* Date.iso8601
* DateTime.iso8601
* Date._rfc3339
* Date.rfc3339
* DateTime.rfc3339
* Date._xmlschema
* Date.xmlschema
* DateTime.xmlschema
* Date._rfc2822
* Date.rfc2822
* DateTime.rfc2822
* Date._rfc822
* Date.rfc822
* DateTime.rfc822
* Date._jisx0301
* Date.jisx0301
* DateTime.jisx0301

Gbp-Pq: Name CVE-2021-41817.patch
ext/date/date_core.c
test/date/test_date_parse.rb