mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
lib/rubygems: fix several vulnerabilities in RubyGems; bump to version 2.6.13.
[Backport #13842] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fd41a38470
commit
8ae151e7ab
11 changed files with 193 additions and 8 deletions
|
@ -108,6 +108,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
|
||||
private_constant :LOAD_CACHE if defined? private_constant
|
||||
|
||||
VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:
|
||||
|
||||
# :startdoc:
|
||||
|
||||
##
|
||||
|
@ -2671,9 +2673,15 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
end
|
||||
end
|
||||
|
||||
unless String === name then
|
||||
if !name.is_a?(String) then
|
||||
raise Gem::InvalidSpecificationException,
|
||||
"invalid value for attribute name: \"#{name.inspect}\""
|
||||
"invalid value for attribute name: \"#{name.inspect}\" must be a string"
|
||||
elsif name !~ /[a-zA-Z]/ then
|
||||
raise Gem::InvalidSpecificationException,
|
||||
"invalid value for attribute name: #{name.dump} must include at least one letter"
|
||||
elsif name !~ VALID_NAME_PATTERN then
|
||||
raise Gem::InvalidSpecificationException,
|
||||
"invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
|
||||
end
|
||||
|
||||
if raw_require_paths.empty? then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue