[前][次][番号順一覧][スレッド一覧]

ruby-changes:43618

From: ngoto <ko1@a...>
Date: Fri, 15 Jul 2016 21:35:58 +0900 (JST)
Subject: [ruby-changes:43618] ngoto:r55691 (trunk): * string.c (str_buf_cat): Fix capa size for embed string.

ngoto	2016-07-15 21:35:52 +0900 (Fri, 15 Jul 2016)

  New Revision: 55691

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55691

  Log:
    * string.c (str_buf_cat): Fix capa size for embed string.
      Fix bug in r55547. [Bug #12536]

  Modified files:
    trunk/ChangeLog
    trunk/string.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55690)
+++ ChangeLog	(revision 55691)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jul 15 21:30:38 2016  Naohisa Goto  <ngotogenome@g...>
+
+	* string.c (str_buf_cat): Fix capa size for embed string.
+	  Fix bug in r55547. [Bug #12536]
+
 Fri Jul 15 18:13:15 2016  SHIBATA Hiroshi  <hsbt@r...>
 
 	* gems/bundled_gems: update latest gems.
Index: string.c
===================================================================
--- string.c	(revision 55690)
+++ string.c	(revision 55691)
@@ -2570,7 +2570,7 @@ str_buf_cat(VALUE str, const char *ptr, https://github.com/ruby/ruby/blob/trunk/string.c#L2570
     rb_str_modify(str);
     if (len == 0) return 0;
     if (STR_EMBED_P(str)) {
-	capa = RSTRING_EMBED_LEN_MAX + termlen - 1;
+	capa = RSTRING_EMBED_LEN_MAX + 1 - termlen;
 	sptr = RSTRING(str)->as.ary;
 	olen = RSTRING_EMBED_LEN(str);
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]