summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 14:27:58 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 14:27:58 +0000
commit911ade36df679fbc816456d5d58b5fc8fb1e0db4 (patch)
tree16d157cea288361b903dac7a0a1938c1cf0a01bf
parent26eb8e4b4e39aee7c1e4e9c061c9c17daaafc78b (diff)
merge revision(s) 51575,51584: [Backport #11439]
* ext/win32/lib/win32/registry.rb (API#SetValue): add terminator size, not 1 byte. [ruby-core:70365] [Bug #11439] * ext/win32/lib/win32/registry.rb (API#SetValue): data size should be in bytes, not in chars. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--ext/win32/lib/win32/registry.rb2
-rw-r--r--version.h2
3 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b784bce87c..06b5029527 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Aug 17 23:27:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (API#SetValue): data size should
+ be in bytes, not in chars. [ruby-core:70365] [Bug #11439]
+
+Mon Aug 17 23:27:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (API#SetValue): add terminator
+ size, not 1 byte. [ruby-core:70365] [Bug #11439]
+
Mon Aug 17 17:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* re.c (rb_memsearch): should match only char boundaries in wide
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index d1cc06e970..911821a1b3 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -315,7 +315,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
case type
when REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ
data = data.encode(WCHAR)
- size ||= data.size + 1
+ size ||= data.bytesize + WCHAR_SIZE
end
check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size)
end
diff --git a/version.h b/version.h
index 9637c01abc..4f8c2a8516 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.7"
#define RUBY_RELEASE_DATE "2015-08-17"
-#define RUBY_PATCHLEVEL 398
+#define RUBY_PATCHLEVEL 399
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 8