Add test for erb flow

This commit is contained in:
Harry Maclean
2024-01-04 12:31:13 +00:00
committed by Tom Hvitved
parent 2d95ac9d5f
commit bf3b86b402
5 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
testFailures
edges
nodes
subpaths
#select

View File

@@ -0,0 +1,13 @@
/**
* @kind path-problem
*/
import codeql.ruby.AST
import codeql.ruby.CFG
import TestUtilities.InlineFlowTest
import ValueFlowTest<DefaultFlowConfig>
import ValueFlow::PathGraph
from ValueFlow::PathNode source, ValueFlow::PathNode sink
where ValueFlow::flowPath(source, sink)
select sink, source, sink, "$@", source, source.toString()

View File

@@ -0,0 +1,7 @@
class App
def run
x = source(1)
view = View.new(x)
render(view)
end
end

View File

@@ -0,0 +1 @@
<%= foo() %>

View File

@@ -0,0 +1,9 @@
class View
def initialize(x)
@x = x
end
def foo
sink(@x) # $ hasValueFlow=1
end
end