diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-06-26 01:48:01 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-09 21:51:39 +0900 |
commit | da652e1827a47c8ee37fab72832ba8324c94911f (patch) | |
tree | 0fcb107e35a26a3ef65f175052506c474930c510 /test | |
parent | 12a0a89e22fbc312e4a95a7749bc153532daa855 (diff) | |
download | ruby-da652e1827a47c8ee37fab72832ba8324c94911f.tar.gz |
Check month overflow when marshal
https://hackerone.com/reports/1244185
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index c629a59c02..b3dc5d99e3 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -386,6 +386,11 @@ class TestTime < Test::Unit::TestCase end end + def test_marshal_broken_month + data = "\x04\x08u:\tTime\r\x20\x7c\x1e\xc0\x00\x00\x00\x00" + assert_equal(Time.utc(2022, 4, 1), Marshal.load(data)) + end + def test_marshal_distant_past assert_marshal_roundtrip(Time.utc(1890, 1, 1)) assert_marshal_roundtrip(Time.utc(-4.5e9, 1, 1)) |