ruby/backport-CVE-2024-27281-Fix-NoMethodError-for-start_with.patch
shixuantong 6c115659e0 fix CVE-2024-27281
(cherry picked from commit bc97dd2175636180297b5f0499ae3c971dab1746)
2024-04-03 15:21:44 +08:00

27 lines
853 B
Diff

From a5de13bf0f0c26f8e764e82b5bf4bf8bffc7198e Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Date: Thu, 21 Mar 2024 13:18:13 +0900
Subject: [PATCH] Fix NoMethodError for start_with
Reference:https://github.com/ruby/rdoc/commit/a5de13bf0f0c26f8e764e82b5bf4bf8bffc7198e
---
lib/rdoc/store.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rdoc/store.rb b/lib/rdoc/store.rb
index 8851549..07d03e9 100644
--- a/lib/rdoc/store.rb
+++ b/lib/rdoc/store.rb
@@ -964,7 +964,7 @@ class RDoc::Store
case obj
when true, false, nil, Array, Class, Encoding, Hash, Integer, String, Symbol, RDoc::Text
else
- unless obj.class.name.start_with("RDoc::")
+ unless obj.class.name.start_with?("RDoc::")
raise TypeError, "not permitted class: #{obj.class.name}"
end
end
--
2.33.0