[3737] MacRuby/branches/icu/string.c
Revision: 3737 http://trac.macosforge.org/projects/ruby/changeset/3737 Author: lsansonetti@apple.com Date: 2010-03-11 14:01:01 -0800 (Thu, 11 Mar 2010) Log Message: ----------- fixed a memory corruption in #succ Modified Paths: -------------- MacRuby/branches/icu/string.c Modified: MacRuby/branches/icu/string.c =================================================================== --- MacRuby/branches/icu/string.c 2010-03-11 22:00:38 UTC (rev 3736) +++ MacRuby/branches/icu/string.c 2010-03-11 22:01:01 UTC (rev 3737) @@ -2655,6 +2655,8 @@ else { rb_ary_push(ary, scan_result); } + + rb_backref_set(match); } return block_given ? self : ary; @@ -4238,7 +4240,8 @@ "cannot make receiver data as Unicode characters"); } - UChar *chars_buf = (UChar *)malloc(RSTR(str)->length_in_bytes); + UChar *chars_buf = (UChar *)malloc(RSTR(str)->length_in_bytes + + sizeof(UChar)); UChar *chars_ptr = &chars_buf[1]; memcpy(chars_ptr, RSTR(str)->data.uchars, RSTR(str)->length_in_bytes);
participants (1)
-
source_changes@macosforge.org