summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-07 02:00:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-07 02:00:48 +0900
commit2bc09665ab8e72d4320a55a274eae903262f29cd (patch)
tree747c5470e2f635c41d48afbe8e2fcea8d7004d99 /ext
parent09a2189c1b5dd5a28a052f9464a516213f89d6e7 (diff)
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/win32/lib/win32/registry.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index ea04bb34bf..451499b166 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -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