diff --git a/ChangeLog b/ChangeLog index 8e5f0e06ff..a0a85b69e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Aug 9 21:16:22 2017 Nobuyoshi Nakada + + * marshal.c (rb_marshal_dump_limited): do not free dump_arg, which + may be dereferenced in check_dump_arg due to continuation, and + get rid of dangling pointers. + + * marshal.c (rb_marshal_load_with_proc): ditto for load_arg. + Wed Aug 9 21:13:24 2017 NAKAMURA Usaku * compile.c (iseq_compile_each): remove unused definition of unused diff --git a/marshal.c b/marshal.c index b7274bf3c4..adaec35826 100644 --- a/marshal.c +++ b/marshal.c @@ -1051,8 +1051,8 @@ rb_marshal_dump_limited(VALUE obj, VALUE port, int limit) rb_io_write(arg->dest, arg->str); rb_str_resize(arg->str, 0); } - free_dump_arg(arg); - rb_gc_force_recycle(wrapper); + clear_dump_arg(arg); + RB_GC_GUARD(wrapper); return port; } @@ -2090,8 +2090,8 @@ rb_marshal_load_with_proc(VALUE port, VALUE proc) if (!NIL_P(proc)) arg->proc = proc; v = r_object(arg); - free_load_arg(arg); - rb_gc_force_recycle(wrapper); + clear_load_arg(arg); + RB_GC_GUARD(wrapper); return v; } diff --git a/version.h b/version.h index 73e3535785..d429921f39 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-08-09" -#define RUBY_PATCHLEVEL 360 +#define RUBY_PATCHLEVEL 361 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 8