зеркало из https://github.com/github/ruby.git
Get rid of exponential backtracks found by CodeQL
Since these regexps are used at build/installation, they are not vulnerabilities.
This commit is contained in:
Родитель
6cee10d8fd
Коммит
99c60d4b25
|
@ -88,7 +88,7 @@ File.foreach "config.status" do |line|
|
|||
unless $install_name
|
||||
$install_name = "ruby"
|
||||
val.gsub!(/\$\$/, '$')
|
||||
val.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\\?\W)((?:(?!\3)(?:\\.|.))*)\3((?:(?!\3)(?:\\.|.))*)\3([gi]*)]) do
|
||||
val.scan(%r[\G[\s;]*(/(?:\\.|[^/])*+/)?([sy])(\\?\W)((?:(?!\3)(?:\\.|.))*+)\3((?:(?!\3)(?:\\.|.))*+)\3([gi]*)]) do
|
||||
|addr, cmd, sep, pat, rep, opt|
|
||||
if addr
|
||||
Regexp.new(addr[/\A\/(.*)\/\z/, 1]) =~ $install_name or next
|
||||
|
|
|
@ -504,7 +504,7 @@ $script_installer = Class.new(installer) do
|
|||
if trans = CONFIG["program_transform_name"]
|
||||
exp = []
|
||||
trans.gsub!(/\$\$/, '$')
|
||||
trans.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\\?\W)((?:(?!\3)(?:\\.|.))*)\3((?:(?!\3)(?:\\.|.))*)\3([gi]*)]) do
|
||||
trans.scan(%r[\G[\s;]*(/(?:\\.|[^/])*+/)?([sy])(\\?\W)((?:(?!\3)(?:\\.|.))*+)\3((?:(?!\3)(?:\\.|.))*+)\3([gi]*)]) do
|
||||
|addr, cmd, sep, pat, rep, opt|
|
||||
addr &&= Regexp.new(addr[/\A\/(.*)\/\z/, 1])
|
||||
case cmd
|
||||
|
|
Загрузка…
Ссылка в новой задаче