ruby/lib/rubygems/package
Martin Emde e913431687 [rubygems/rubygems] Raise Gem::Package::FormatError on EOF, indicating corrupt gem
Gem::Package::TarReader::Entry now raises EOFError or returns nil
appropriately based on Ruby core IO.read and IO.readpartial behavior.

Zlib will respond accordingly by raising Zlib::GzipFile::Error on EOF.

When verifying a gem or extracting contents, raise FormatError similar
to other cases of corrupt gems.

Addresses a bug where Gem::Package would attempt to call size on nil
instead of raising a more descriptive and useful error, leading users
to assume the problem is internal to rubygems.

Remove unused error class TarReader::UnexpectedEOF that was never raised
since the NoMethodError on nil would happen first. Use EOFError instead.

https://github.com/rubygems/rubygems/commit/dc6129644b
2023-08-17 23:16:57 +00:00
..
tar_reader [rubygems/rubygems] Raise Gem::Package::FormatError on EOF, indicating corrupt gem 2023-08-17 23:16:57 +00:00
digest_io.rb util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
file_source.rb util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
io_source.rb util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
old.rb util/rubocop -A --only Style/NumericLiteralPrefix 2023-04-11 19:12:28 +09:00
source.rb util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
tar_header.rb [rubygems/rubygems] auto-correct Style/YodaCondition 2023-06-15 07:01:28 +09:00
tar_reader.rb [rubygems/rubygems] Raise Gem::Package::FormatError on EOF, indicating corrupt gem 2023-08-17 23:16:57 +00:00
tar_writer.rb util/rubocop -A --only Style/NumericLiteralPrefix 2023-04-11 19:12:28 +09:00