summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--gc.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 30a25a6ca3..6e1cc77216 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
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;
}