diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-25 08:38:14 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-25 08:38:14 +0000 |
commit | 364be8e7c214106f4c6e3f9f6cb75a54addb237f (patch) | |
tree | 099d9851956d2a57c374686a283daa0dacb9c95d | |
parent | d26f82db515de3d3f16247041b5350d809dca236 (diff) |
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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gc.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Thu Dec 25 17:37:47 2014 Naohisa Goto <ngotogenome@gmail.com> + + * 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] + Thu Dec 25 17:31:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (NET_LUID): include winsock2.h instead of windows.h. @@ -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; } |