Skip to content

Commit bf3b86b

Browse files
hmachvitved
authored andcommitted
Add test for erb flow
1 parent 2d95ac9 commit bf3b86b

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
testFailures
2+
edges
3+
nodes
4+
subpaths
5+
#select
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @kind path-problem
3+
*/
4+
5+
import codeql.ruby.AST
6+
import codeql.ruby.CFG
7+
import TestUtilities.InlineFlowTest
8+
import ValueFlowTest<DefaultFlowConfig>
9+
import ValueFlow::PathGraph
10+
11+
from ValueFlow::PathNode source, ValueFlow::PathNode sink
12+
where ValueFlow::flowPath(source, sink)
13+
select sink, source, sink, "$@", source, source.toString()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class App
2+
def run
3+
x = source(1)
4+
view = View.new(x)
5+
render(view)
6+
end
7+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= foo() %>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class View
2+
def initialize(x)
3+
@x = x
4+
end
5+
6+
def foo
7+
sink(@x) # $ hasValueFlow=1
8+
end
9+
end

0 commit comments

Comments
 (0)