aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/package
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-01 03:11:34 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-01 03:11:34 +0000
commitec84bfc9e3d11a3b1dbebcaf4d1ddf1357307513 (patch)
treecc3b9df7f06f86c52f4d09c03f5c9a3876c87b67 /lib/rubygems/package
parentf4234c9b8f4707c5979d9a3beddc19ceeb417bd8 (diff)
downloadruby-ec84bfc9e3d11a3b1dbebcaf4d1ddf1357307513.tar.gz
Import rubygems 1.5.0 (released version @ 1fb59d0)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/package')
-rw-r--r--lib/rubygems/package/tar_input.rb6
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb4
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/rubygems/package/tar_input.rb b/lib/rubygems/package/tar_input.rb
index 587d79c493..401df80a83 100644
--- a/lib/rubygems/package/tar_input.rb
+++ b/lib/rubygems/package/tar_input.rb
@@ -117,7 +117,11 @@ class Gem::Package::TarInput
@tarreader.rewind
@fileops = Gem::FileOperations.new
- raise Gem::Package::FormatError, "No metadata found!" unless has_meta
+ unless has_meta then
+ path = io.path if io.respond_to? :path
+ error = Gem::Package::FormatError.new 'no metadata found', path
+ raise error
+ end
end
def close
diff --git a/lib/rubygems/package/tar_reader/entry.rb b/lib/rubygems/package/tar_reader/entry.rb
index d5c624f3d5..c70248f159 100644
--- a/lib/rubygems/package/tar_reader/entry.rb
+++ b/lib/rubygems/package/tar_reader/entry.rb
@@ -73,6 +73,10 @@ class Gem::Package::TarReader::Entry
else
@header.name
end
+ rescue ArgumentError => e
+ raise unless e.message == 'string contains null byte'
+ raise Gem::Package::TarInvalidError,
+ 'tar is corrupt, name contains null byte'
end
##