ruby-changes:57285
From: usa <ko1@a...>
Date: Tue, 27 Aug 2019 01:18:01 +0900 (JST)
Subject: [ruby-changes:57285] usa: 080e04e863 (ruby_2_5): merge revision(s) 8f51da5d41f0642d5a971e4223d1ba14643c6398: [Backport #15946]
https://git.ruby-lang.org/ruby.git/commit/?id=080e04e863 From 080e04e863cbbd6d6ec0aa4b00c92ffb095a7ce3 Mon Sep 17 00:00:00 2001 From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Mon, 26 Aug 2019 16:17:49 +0000 Subject: merge revision(s) 8f51da5d41f0642d5a971e4223d1ba14643c6398: [Backport #15946] Get rid of undefined behavior * string.c (rb_str_sub_bang): str and repl can be same. [Bug #15946] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e diff --git a/string.c b/string.c index 5f8bd36..ab04ac7 100644 --- a/string.c +++ b/string.c @@ -5016,7 +5016,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L5016 if (rlen != plen) { memmove(p + beg0 + rlen, p + beg0 + plen, len - beg0 - plen); } - memcpy(p + beg0, rp, rlen); + memmove(p + beg0, rp, rlen); len += rlen - plen; STR_SET_LEN(str, len); TERM_FILL(&RSTRING_PTR(str)[len], TERM_LEN(str)); diff --git a/version.h b/version.h index 62221f0..e08522e 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1 #define RUBY_VERSION "2.5.6" #define RUBY_RELEASE_DATE "2019-08-27" -#define RUBY_PATCHLEVEL 188 +#define RUBY_PATCHLEVEL 189 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 8 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/