Buglet in 'gem check --alien'

H

Han Holl

Hello,

Running 'gem check --alien' will fail if there is a gem installed with
an empty file, like actionmailer-1.3.3 and others.
The problem is in rubygems/validator.rb:

format.file_entries.each do |entry, data|
# Found this file. Delete it from list
installed_files.delete remove_leading_dot_dir(entry['path'])
File.open(File.join(gem_directory, entry['path']), 'rb') do |f|
unless Gem::MD5.hexdigest(f.read).to_s == Gem::MD5.hexdigest(data).to_s
errors[gem_name] << ErrorData.new(entry['path'], "installed
file doesn't match original from gem")
end
end
end

An empty file will produce data as nil, which leads to a TypeError on
the hexdigest(data).
Adding 'data='' if data.nil?' helps, but may not be the best solution.

Cheers,

Han Holl
 
E

Eric Hodel

Hello,

Running 'gem check --alien' will fail if there is a gem installed with
an empty file, like actionmailer-1.3.3 and others.

File a bug in the tracker. Bug reports filed by email will be ignored.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top