aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-14 09:42:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-14 09:42:13 +0000
commit18476346643e3a8f71366f24dd981f0e5541e2e3 (patch)
tree28cc06be5c88195b29c13fbe483ab958fea4815f
parent6612c62418c4d77ae0ec57947f0969ba0f791fe0 (diff)
downloadruby-18476346643e3a8f71366f24dd981f0e5541e2e3.tar.gz
win32/registry.rb: terminator size
* ext/win32/lib/win32/registry.rb (API#SetValue): add terminator size, not 1 byte. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/win32/lib/win32/registry.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cb94fb876a..e5a3cf07f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 14 18:40:43 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]
+
Thu Aug 13 22:49:42 2015 Juanito Fatas <katehuang0320@gmail.com>
* lib/timeout.rb (Timeout#timeout): freeze a string message to
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index 1e12f4bafc..3830a5a3ee 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -326,7 +326,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.size + WCHAR_SIZE
end
check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size)
end