From 4d683d0566a16c3a7bc0d91bb92a36358613cf63 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 30 Mar 2015 15:49:32 +0000 Subject: merge revision(s) r48999,r49484: [Backport #10646] * gc.c (wmap_final_func): fix memory size shortage when realloc wmap. Fix SEGV during finilize of WeakRef on Solaris (though the SEGV could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646] Fix SEGV during finalize of WeakRef on Solaris (though the SEGV git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ gc.c | 2 +- version.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 953dc96790..3745a2d304 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Mar 31 00:49:23 2015 Naohisa Goto + + * gc.c (wmap_final_func): fix memory size shortage when realloc wmap. + Fix SEGV during finalize of WeakRef on Solaris (though the SEGV + could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646] + Tue Mar 31 00:38:14 2015 Seiei Higa * vm_method.c (rb_method_entry): if no super class, no original diff --git a/gc.c b/gc.c index cc37327463..f9048e031a 100644 --- a/gc.c +++ b/gc.c @@ -6413,7 +6413,7 @@ wmap_final_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing) return ST_DELETE; } if (j < i) { - ptr = ruby_sized_xrealloc2(ptr, j, sizeof(VALUE), i); + ptr = ruby_sized_xrealloc2(ptr, j + 1, sizeof(VALUE), i); ptr[0] = j; *value = (st_data_t)ptr; } diff --git a/version.h b/version.h index 94b9d22f16..bd5dbad4aa 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.5" #define RUBY_RELEASE_DATE "2015-03-31" -#define RUBY_PATCHLEVEL 327 +#define RUBY_PATCHLEVEL 328 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 3 -- cgit v1.2.3