mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
add failing test
This commit is contained in:
@@ -49,4 +49,20 @@ class FooController < ActionController::Base
|
||||
puts "foo"
|
||||
end
|
||||
end
|
||||
|
||||
def some_other_request_handle
|
||||
name = params[:name] # source
|
||||
|
||||
indirect_use_of_reg /^\s+|\s+$/, name
|
||||
|
||||
as_string_indirect '^\s+|\s+$', name
|
||||
end
|
||||
|
||||
def indirect_use_of_reg (reg, input)
|
||||
input.gsub reg, '' # NOT GOOD
|
||||
end
|
||||
|
||||
def as_string_indirect (reg_as_string, input)
|
||||
input.match? reg_as_string, '' # NOT GOOD
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user