[macruby-changes] [3737] MacRuby/branches/icu/string.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 11 14:01:01 PST 2010


Revision: 3737
          http://trac.macosforge.org/projects/ruby/changeset/3737
Author:   lsansonetti at 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);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100311/c6184976/attachment.html>


More information about the macruby-changes mailing list