* 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/trunk@48999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ngoto 2014-12-25 08:33:41 +00:00
Родитель e13315da2f
Коммит 7632a82d57
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Thu Dec 25 17:30:40 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:27:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (NET_LUID): include winsock2.h instead of windows.h.

2
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;
}