From 364be8e7c214106f4c6e3f9f6cb75a54addb237f Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 25 Dec 2014 08:38:14 +0000 Subject: merge revision(s) 48999: [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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index c75f8637c0..5f67bdec29 100644 --- a/gc.c +++ b/gc.c @@ -7672,7 +7672,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; } -- cgit v1.2.3