From 2073258a7d192e8d2bc853e10464a7a5fcac8f2d Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 5 Jun 2012 11:13:18 +0000 Subject: obj_init_copy * object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index 3d4fe54848..f24bfbb5b0 100644 --- a/io.c +++ b/io.c @@ -6387,7 +6387,7 @@ rb_io_init_copy(VALUE dest, VALUE io) off_t pos; io = rb_io_get_io(io); - if (dest == io) return dest; + if (!OBJ_INIT_COPY(dest, io)) return dest; GetOpenFile(io, orig); MakeOpenFile(dest, fptr); @@ -7286,6 +7286,7 @@ argf_initialize(VALUE argf, VALUE argv) static VALUE argf_initialize_copy(VALUE argf, VALUE orig) { + if (!OBJ_INIT_COPY(argf, orig)) return argf; ARGF = argf_of(orig); ARGF.argv = rb_obj_dup(ARGF.argv); if (ARGF.inplace) { -- cgit v1.2.3