diff options
-rw-r--r-- | lib/rubygems/indexer.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/safe_marshal.rb | 71 | ||||
-rw-r--r-- | lib/rubygems/safe_marshal/elements.rb | 138 | ||||
-rw-r--r-- | lib/rubygems/safe_marshal/reader.rb | 182 | ||||
-rw-r--r-- | lib/rubygems/safe_marshal/visitors/to_ruby.rb | 266 | ||||
-rw-r--r-- | lib/rubygems/safe_marshal/visitors/visitor.rb | 74 | ||||
-rw-r--r-- | lib/rubygems/source.rb | 9 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 3 |
8 files changed, 741 insertions, 5 deletions
@@ -411,7 +411,8 @@ class Gem::Indexer # +dest+. For a latest index, does not ensure the new file is minimal. def update_specs_index(index, source, dest) - specs_index = Marshal.load Gem.read_binary(source) index.each do |spec| platform = spec.original_platform @@ -0,0 +1,71 @@ @@ -0,0 +1,138 @@ @@ -0,0 +1,182 @@ @@ -0,0 +1,266 @@ @@ -0,0 +1,74 @@ @@ -135,8 +135,9 @@ class Gem::Source if File.exist? local_spec spec = Gem.read_binary local_spec spec = begin - Marshal.load(spec) rescue StandardError nil end @@ -157,8 +158,9 @@ class Gem::Source end end # TODO: Investigate setting Gem::Specification#loaded_from to a URI - Marshal.load spec end ## @@ -188,8 +190,9 @@ class Gem::Source spec_dump = fetcher.cache_update_path spec_path, local_file, update_cache? begin - Gem::NameTuple.from_list Marshal.load(spec_dump) rescue ArgumentError if update_cache? && !retried FileUtils.rm local_file @@ -1300,12 +1300,13 @@ class Gem::Specification < Gem::BasicSpecification def self._load(str) Gem.load_yaml yaml_set = false retry_count = 0 array = begin - Marshal.load str rescue ArgumentError => e # Avoid an infinite retry loop when the argument error has nothing to do # with the classes not being defined. |