Bug #7526

infinit loop in Registry::each_value

Added by first last over 1 year ago. Updated about 1 year ago.

[ruby-core:50627]
Status:Assigned
Priority:Normal
Assignee:Usaku NAKAMURA
Category:lib
Target version:next minor
ruby -v:All Backport:

Description

in win32/registry.rb :
begin
type, data = read(subkey)
rescue Error
next
end
the correction :
rescue Error
index += 1
next
end

I think that using Registry::info to get the number of values (also number of subkeys in each_key)
is a better solution so to skip problematic values.

also a limitation in Registry::read
when REG_BINARY
[ type, data ]

should be :
when REGBINARY, REGNONE, REGLINK, REGRESOURCELIST, REGRESOURCEREQUIREMENTSLIST
[ type, data ]

instead of raising an exception for those types (in regedit.exe REGNONE is equivalent to REGBINARY)

History

#1 Updated by Usaku NAKAMURA over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA
  • Target version set to 2.0.0

#2 Updated by first last over 1 year ago

rubyhack (first last) wrote:

the correction :
rescue Error
index += 1
next
end

that is: add only the line: "index += 1" to the lib and the bug is fixed

#3 Updated by Yusuke Endoh about 1 year ago

  • Target version changed from 2.0.0 to next minor

Let me know if there is any popular application that suffers from this issue.

Yusuke Endoh mame@tsg.ne.jp

Also available in: Atom PDF