1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

win32/registry.rb: fix potential infinite loop

* ext/win32/lib/win32/registry.rb (Win32::Registry#each_value):
  advance the index even if an error occurred in #read.
This commit is contained in:
Nobuyoshi Nakada 2019-06-07 02:00:48 +09:00
parent 09a2189c1b
commit 2bc09665ab
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -575,9 +575,9 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
begin
type, data = read(subkey)
rescue Error
next
else
yield subkey, type, data
end
yield subkey, type, data
index += 1
end
index