mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* marshal.c (r_object0): raise ArgumentError when linking to undefined
object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e91e50d05e
commit
c9165d0644
3 changed files with 22 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Mar 17 07:17:36 2016 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* marshal.c (r_object0): raise ArgumentError when linking to undefined
|
||||
object.
|
||||
|
||||
Thu Mar 17 00:45:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||
|
||||
* test/ruby/test_bignum.rb: Make sure to use Bignum values in the tests.
|
||||
|
|
|
@ -1965,6 +1965,11 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
|
|||
rb_raise(rb_eArgError, "dump format error(0x%x)", type);
|
||||
break;
|
||||
}
|
||||
|
||||
if (v == Qundef) {
|
||||
rb_raise(rb_eArgError, "dump format error (bad link)");
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
@ -725,4 +725,16 @@ class TestMarshal < Test::Unit::TestCase
|
|||
opt = %w[--disable=gems]
|
||||
assert_ruby_status(opt, "Marshal.load(#{crash.dump})")
|
||||
end
|
||||
|
||||
def test_marshal_load_r_prepare_reference_crash
|
||||
crash = "\x04\bI/\x05\x00\x06:\x06E{\x06@\x05T"
|
||||
|
||||
opt = %w[--disable=gems]
|
||||
assert_ruby_status(opt, <<-RUBY)
|
||||
begin
|
||||
Marshal.load(#{crash.dump})
|
||||
rescue ArgumentError
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue