Skip to content

Commit 95c764e

Browse files
committed
Fix Sinatra test to properly output pathgraph
1 parent 6dbdc9e commit 95c764e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

ruby/ql/test/library-tests/frameworks/sinatra/Flow.expected

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,25 @@ edges
77
| app.rb:76:25:76:36 | call to [] [element :foo] | views/index.erb:2:10:2:12 | call to foo | provenance | |
88
| app.rb:76:32:76:35 | @foo | app.rb:76:25:76:36 | call to [] [element :foo] | provenance | |
99
| app.rb:76:32:76:35 | self [@foo] | app.rb:76:32:76:35 | @foo | provenance | |
10+
| app.rb:95:10:95:14 | self [@user] | app.rb:95:10:95:14 | @user | provenance | |
11+
| app.rb:102:10:104:5 | [post] do ... end [captured self, @user] | app.rb:95:10:95:14 | self [@user] | provenance | |
12+
| app.rb:103:5:103:9 | [post] self [@user] | app.rb:102:10:104:5 | [post] do ... end [captured self, @user] | provenance | |
13+
| app.rb:103:5:103:9 | [post] self [@user] | app.rb:102:10:104:5 | [post] do ... end [captured self, @user] | provenance | heuristic-callback |
14+
| app.rb:103:13:103:22 | call to source | app.rb:103:5:103:9 | [post] self [@user] | provenance | |
1015
nodes
1116
| app.rb:75:5:75:8 | [post] self [@foo] | semmle.label | [post] self [@foo] |
1217
| app.rb:75:12:75:17 | call to params | semmle.label | call to params |
1318
| app.rb:75:12:75:24 | ...[...] | semmle.label | ...[...] |
1419
| app.rb:76:25:76:36 | call to [] [element :foo] | semmle.label | call to [] [element :foo] |
1520
| app.rb:76:32:76:35 | @foo | semmle.label | @foo |
1621
| app.rb:76:32:76:35 | self [@foo] | semmle.label | self [@foo] |
22+
| app.rb:95:10:95:14 | @user | semmle.label | @user |
23+
| app.rb:95:10:95:14 | self [@user] | semmle.label | self [@user] |
24+
| app.rb:102:10:104:5 | [post] do ... end [captured self, @user] | semmle.label | [post] do ... end [captured self, @user] |
25+
| app.rb:103:5:103:9 | [post] self [@user] | semmle.label | [post] self [@user] |
26+
| app.rb:103:13:103:22 | call to source | semmle.label | call to source |
1727
| views/index.erb:2:10:2:12 | call to foo | semmle.label | call to foo |
1828
subpaths
1929
#select
30+
| app.rb:95:10:95:14 | @user | app.rb:103:13:103:22 | call to source | app.rb:95:10:95:14 | @user | $@ | app.rb:103:13:103:22 | call to source | call to source |
2031
| views/index.erb:2:10:2:12 | call to foo | app.rb:75:12:75:17 | call to params | views/index.erb:2:10:2:12 | call to foo | $@ | app.rb:75:12:75:17 | call to params | call to params |

ruby/ql/test/library-tests/frameworks/sinatra/Flow.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import ruby
66
import TestUtilities.InlineFlowTest
7-
import TaintFlow::PathGraph
7+
import PathGraph
88
import codeql.ruby.frameworks.Sinatra
99
import codeql.ruby.Concepts
1010

@@ -18,6 +18,6 @@ module SinatraConfig implements DataFlow::ConfigSig {
1818

1919
import FlowTest<DefaultFlowConfig, SinatraConfig>
2020

21-
from TaintFlow::PathNode source, TaintFlow::PathNode sink
22-
where TaintFlow::flowPath(source, sink)
21+
from PathNode source, PathNode sink
22+
where flowPath(source, sink)
2323
select sink, source, sink, "$@", source, source.toString()

0 commit comments

Comments
 (0)