diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-30 21:23:37 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2020-09-15 20:55:40 +0900 |
| commit | 7d76314885be3532999684356657ce36da84d04e (patch) | |
| tree | aae23ff9ce30ff03c1f0867c0bc46ea968e8e324 /lib/rubygems/util.rb | |
| parent | 3590f082442afc4506250f5274a7877371a112de (diff) | |
Merge RubyGems 3.1.4
Diffstat (limited to 'lib/rubygems/util.rb')
| -rw-r--r-- | lib/rubygems/util.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rubygems/util.rb b/lib/rubygems/util.rb index b5f1408401..7fc239af9a 100644 --- a/lib/rubygems/util.rb +++ b/lib/rubygems/util.rb @@ -14,7 +14,13 @@ module Gem::Util require 'stringio' data = StringIO.new(data, 'r') - unzipped = Zlib::GzipReader.new(data).read + gzip_reader = begin + Zlib::GzipReader.new(data) + rescue Zlib::GzipFile::Error => e + raise e.class, e.inspect, e.backtrace + end + + unzipped = gzip_reader.read unzipped.force_encoding Encoding::BINARY unzipped end |
