summaryrefslogtreecommitdiff
path: root/ext/win32/lib/win32/registry.rb
AgeCommit message (Collapse)Author
2023-12-28Fix memory overread in registry.rbKJ Tsanaktsidis
The terminator is not actually getting filled in; we're simply passing (two) bytes of empty memory as the NUL terminator. This can lead to garbage characters getting written to registry values. Fix this by explicitly putting a WCHAR_NUL character into the string to be sent to the registry API, like we do in the MULTI_SZ case. [Bug #20096]
2021-01-05[DOC] Fix grammar: "is same as" -> "is the same as"Marcus Stollsteimer
2020-11-11Use Fiddle::Importer directlyHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3712
2019-06-07win32/registry.rb: fix potential infinite loopNobuyoshi Nakada
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_value): advance the index even if an error occurred in #read.
2017-10-21Treat REG_NONE just like REG_BINARYusa
* ext/win32/lib/win32/registry.rb (read, write): treat REG_NONE just like REG_BINARY when reading and writing. cf. [Bug #7526] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-04win32/registry.rb: registry type namesnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry#read): show registry type names instead of numeric values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-10registry.rb: fix API namesnobu
* ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix API names. [ruby-core:74863] [Bug #12264] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16handle ext/ as r53141naruse
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15win32/registry.rb: size in bytesnobu
* 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/trunk@51584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14win32/registry.rb: terminator sizenobu
* 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
2015-08-14win32/registry.rb: make @@type2name an arraynobu
* ext/win32/lib/win32/registry.rb (@@type2name): make an array instead of a hash, keys are sequential numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08registry.rb: wide versionsnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide versions of RegDeleteValue and RegDeleteKey. [ruby-core:67958] [Bug #10820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-23registry.rb: fix buffer overflownobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::Error#initialize): should not re-use sliced string as buffer, to get rid of buffer overflow. [ruby-core:65295] [Bug #10300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-23registry.rb: try en_US messagenobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::Error#initialize): try en_US message if the default message cannot be encoded to locale. [ruby-core:65295] [Bug #10300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09win32/registry.rb: slice in WCHARsnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::API#Enum{Value,Key): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24win32/registry.rb: size in bytesnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry#write): data size is in bytes, not chars. terminators should be placed automatically. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24win32/registry.rb: encode namenobu
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_value): encode name. * ext/win32/lib/win32/registry.rb (Win32::Registry#each_key): ditto. * ext/win32/lib/win32/registry.rb (Win32::Registry#export_string): encode to locale encoding if default internal is not set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24win32/registry.rb: fix runtime errorsnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumKey): size of the name is in WCHARs, not in bytes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24win32/registry.rb: fix runtime errorsnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::API): need Constants. * ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumValue): size of the name is in WCHARs, not in bytes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03* ext/win32/lib/win32/registry.rb (Win32::Registry#values): added.usa
[Feature #7763] [ruby-core:51783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-13ext/win32: movenobu
* ext/win32: move from ext/dl and ext/fiddle. since ext/extmk.rb builds extensions in alphabetical order, compiled?('fiddle') under ext/dl makes no sense. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e