Skip to content

Validate the elements in Date#marshal_load - #204

Open
mame wants to merge 1 commit into
ruby:masterfrom
mame:date-marshal-load-typecheck
Open

mame wants to merge 1 commit into
ruby:masterfrom
mame:date-marshal-load-typecheck

Conversation

@mame

@mame mame commented Nov 13, 2026

Copy link
Copy Markdown
Member

The six-element form stored nth and sf without checking their types, and accepted values that no Date or DateTime can have. Require an Integer for nth and an Integer or Rational for sf, and reject jd, df, sf, of and sg out of the ranges that a Date or DateTime can have.

Reported-by: Hiroshi SHIBATA hsbt@ruby-lang.org

@mame
mame requested a review from nobu November 13, 2026 02:54
The six-element form stored `nth` and `sf` without checking their
types, and accepted values that no Date or DateTime can have. Require
an Integer for `nth` and an Integer or Rational for `sf`, and reject
`jd`, `df`, `sf`, `of` and `sg` out of the ranges that a Date or
DateTime can have.

Reported-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mame
mame force-pushed the date-marshal-load-typecheck branch from aca6f17 to b737125 Compare November 13, 2026 04:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant