110 Star 0 Fork 51

src-openEuler/ruby

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-rubygems-rubygems-Drop-to-support-Psych-3.0-bundled-.patch 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
桐小哥 提交于 2024-06-18 11:14 +08:00 . fix CVE-2024-35221
From 3926ad578c312ddd2ff5221b96ef077b9e24e612 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Date: Thu, 9 Mar 2023 15:42:07 +0900
Subject: [PATCH] [rubygems/rubygems] Drop to support Psych 3.0 bundled at Ruby
2.5
https://github.com/rubygems/rubygems/commit/a6650c2c96
Reference:https://github.com/ruby/ruby/commit/3926ad578c312ddd2ff5221b96ef077b9e24e612
Conflict:NA
---
lib/rubygems/safe_yaml.rb | 32 +++++---------------------------
1 file changed, 5 insertions(+), 27 deletions(-)
diff --git a/lib/rubygems/safe_yaml.rb b/lib/rubygems/safe_yaml.rb
index 5a98505..3a1ae3b 100644
--- a/lib/rubygems/safe_yaml.rb
+++ b/lib/rubygems/safe_yaml.rb
@@ -24,34 +24,12 @@ module Gem
runtime
].freeze
- if ::Psych.respond_to? :safe_load
- def self.safe_load(input)
- if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("3.1.0.pre1")
- ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES, permitted_symbols: PERMITTED_SYMBOLS, aliases: true)
- else
- ::Psych.safe_load(input, PERMITTED_CLASSES, PERMITTED_SYMBOLS, true)
- end
- end
-
- def self.load(input)
- if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("3.1.0.pre1")
- ::Psych.safe_load(input, permitted_classes: [::Symbol])
- else
- ::Psych.safe_load(input, [::Symbol])
- end
- end
- else
- unless Gem::Deprecate.skip
- warn "Psych safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0)."
- end
-
- def self.safe_load(input, *args)
- ::Psych.load input
- end
+ def self.safe_load(input)
+ ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES, permitted_symbols: PERMITTED_SYMBOLS, aliases: true)
+ end
- def self.load(input)
- ::Psych.load input
- end
+ def self.load(input)
+ ::Psych.safe_load(input, permitted_classes: [::Symbol])
end
end
end
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/ruby.git
git@gitee.com:src-openeuler/ruby.git
src-openeuler
ruby
ruby
master

搜索帮助