summaryrefslogtreecommitdiff
path: root/lib/rubygems/specification.rb
diff options
context:
space:
mode:
authorSamuel Giddins <[email protected]>2023-08-18 13:35:23 -0700
committergit <[email protected]>2023-09-20 02:02:58 +0000
commitd182d83ce929cd322f4a6fd134cd31be950eca77 ()
tree18808133999aab348990d35cae6920d0252dfa56 /lib/rubygems/specification.rb
parentc47608494f961d2a8fe24b1a7b7f627b305cf7fe (diff)
[rubygems/rubygems] Add a Marshal.load replacement that walks an AST to safely load permitted classes/symbols
https://.com/rubygems/rubygems/commit/7e4478fe73
-rw-r--r--lib/rubygems/specification.rb3
1 files changed, 2 insertions, 1 deletions
@@ -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.