Project

General

Profile

Feature #7526

infinit loop in Registry::each_value

Added by rubyhack (first last) almost 5 years ago. Updated 1 day ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:50627]

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 REG_BINARY, REG_NONE, REG_LINK, REG_RESOURCE_LIST, REG_RESOURCE_REQUIREMENTS_LIST
[ type, data ]

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

Associated revisions

Revision 60257
Added by usa (Usaku NAKAMURA) 1 day ago

Treat REG_NONE just like REG_BINARY

  • ext/win32/lib/win32/registry.rb (read, write): treat REG_NONE just like REG_BINARY when reading and writing. cf. [Bug #7526]

History

#1 Updated by usa (Usaku NAKAMURA) almost 5 years ago

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

#2 Updated by rubyhack (first last) almost 5 years 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 [ruby-core:52479] Updated by mame (Yusuke Endoh) over 4 years 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

#4 Updated by usa (Usaku NAKAMURA) 1 day ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r60257.


Treat REG_NONE just like REG_BINARY

  • ext/win32/lib/win32/registry.rb (read, write): treat REG_NONE just like REG_BINARY when reading and writing. cf. [Bug #7526]

#5 Updated by usa (Usaku NAKAMURA) 1 day ago

  • Backport deleted (2.3: UNKNOWN, 2.4: UNKNOWN)
  • ruby -v deleted (All)
  • Tracker changed from Bug to Feature

Also available in: Atom PDF