diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-14 18:36:14 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-14 18:36:14 +0000 |
commit | 22d1dba88c81ba4be5f9108885578df0314f832f (patch) | |
tree | f66a6b36d6cb8dc3001489c3b86a34d6657fe88e /test | |
parent | 4e250958b8f0c4a22f29ccdf64afbb4994ed0b99 (diff) | |
download | ruby-22d1dba88c81ba4be5f9108885578df0314f832f.tar.gz |
* marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_marshal.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 8377de2155..49a8511e8e 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -718,4 +718,15 @@ class TestMarshal < Test::Unit::TestCase obj = [str, str] assert_equal(['X', 'X'], Marshal.load(Marshal.dump(obj), ->(v) { v == str ? v.upcase : v })) end + + def test_marshal_load_extended_class_crash + crash = "\x04\be:\x0F\x00omparableo:\vObject\x00" + + opt = %w[--disable=gems] + args = [opt, "Marshal.load(#{crash.dump})", true, true] + out, err, status = EnvUtil.invoke_ruby(*args) + + assert_empty err + assert_predicate(status, :success?) + end end |