mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Ruby: improve test case
This commit is contained in:
@@ -10,6 +10,8 @@ edges
|
||||
| instance_variables.rb:6:16:6:21 | @field : | instance_variables.rb:6:9:6:21 | return : |
|
||||
| instance_variables.rb:6:16:6:21 | self [@field] : | instance_variables.rb:6:16:6:21 | @field : |
|
||||
| instance_variables.rb:6:16:6:21 | self [@field] : | instance_variables.rb:6:16:6:21 | @field : |
|
||||
| instance_variables.rb:8:5:10:7 | self in inc_field [@field] : | instance_variables.rb:9:9:9:14 | [post] self [@field] : |
|
||||
| instance_variables.rb:9:9:9:14 | [post] self [@field] : | instance_variables.rb:9:9:9:14 | [post] self [@field] : |
|
||||
| instance_variables.rb:11:5:11:8 | [post] self [@foo] : | instance_variables.rb:12:10:12:13 | self [@foo] : |
|
||||
| instance_variables.rb:11:5:11:8 | [post] self [@foo] : | instance_variables.rb:12:10:12:13 | self [@foo] : |
|
||||
| instance_variables.rb:11:12:11:22 | call to source : | instance_variables.rb:11:5:11:8 | [post] self [@foo] : |
|
||||
@@ -26,6 +28,11 @@ edges
|
||||
| instance_variables.rb:17:6:17:8 | foo [@field] : | instance_variables.rb:5:5:7:7 | self in get_field [@field] : |
|
||||
| instance_variables.rb:17:6:17:8 | foo [@field] : | instance_variables.rb:17:6:17:18 | call to get_field |
|
||||
| instance_variables.rb:17:6:17:8 | foo [@field] : | instance_variables.rb:17:6:17:18 | call to get_field |
|
||||
| instance_variables.rb:20:1:20:3 | [post] bar [@field] : | instance_variables.rb:21:6:21:8 | bar [@field] : |
|
||||
| instance_variables.rb:20:15:20:23 | call to source : | instance_variables.rb:2:19:2:19 | x : |
|
||||
| instance_variables.rb:20:15:20:23 | call to source : | instance_variables.rb:20:1:20:3 | [post] bar [@field] : |
|
||||
| instance_variables.rb:21:6:21:8 | bar [@field] : | instance_variables.rb:8:5:10:7 | self in inc_field [@field] : |
|
||||
| instance_variables.rb:21:6:21:8 | bar [@field] : | instance_variables.rb:21:6:21:18 | call to inc_field |
|
||||
nodes
|
||||
| instance_variables.rb:2:19:2:19 | x : | semmle.label | x : |
|
||||
| instance_variables.rb:2:19:2:19 | x : | semmle.label | x : |
|
||||
@@ -41,6 +48,8 @@ nodes
|
||||
| instance_variables.rb:6:16:6:21 | @field : | semmle.label | @field : |
|
||||
| instance_variables.rb:6:16:6:21 | self [@field] : | semmle.label | self [@field] : |
|
||||
| instance_variables.rb:6:16:6:21 | self [@field] : | semmle.label | self [@field] : |
|
||||
| instance_variables.rb:8:5:10:7 | self in inc_field [@field] : | semmle.label | self in inc_field [@field] : |
|
||||
| instance_variables.rb:9:9:9:14 | [post] self [@field] : | semmle.label | [post] self [@field] : |
|
||||
| instance_variables.rb:11:5:11:8 | [post] self [@foo] : | semmle.label | [post] self [@foo] : |
|
||||
| instance_variables.rb:11:5:11:8 | [post] self [@foo] : | semmle.label | [post] self [@foo] : |
|
||||
| instance_variables.rb:11:12:11:22 | call to source : | semmle.label | call to source : |
|
||||
@@ -57,11 +66,19 @@ nodes
|
||||
| instance_variables.rb:17:6:17:8 | foo [@field] : | semmle.label | foo [@field] : |
|
||||
| instance_variables.rb:17:6:17:18 | call to get_field | semmle.label | call to get_field |
|
||||
| instance_variables.rb:17:6:17:18 | call to get_field | semmle.label | call to get_field |
|
||||
| instance_variables.rb:20:1:20:3 | [post] bar [@field] : | semmle.label | [post] bar [@field] : |
|
||||
| instance_variables.rb:20:15:20:23 | call to source : | semmle.label | call to source : |
|
||||
| instance_variables.rb:21:6:21:8 | bar [@field] : | semmle.label | bar [@field] : |
|
||||
| instance_variables.rb:21:6:21:18 | call to inc_field | semmle.label | call to inc_field |
|
||||
subpaths
|
||||
| instance_variables.rb:16:15:16:24 | call to source : | instance_variables.rb:2:19:2:19 | x : | instance_variables.rb:3:9:3:14 | [post] self [@field] : | instance_variables.rb:16:1:16:3 | [post] foo [@field] : |
|
||||
| instance_variables.rb:16:15:16:24 | call to source : | instance_variables.rb:2:19:2:19 | x : | instance_variables.rb:3:9:3:14 | [post] self [@field] : | instance_variables.rb:16:1:16:3 | [post] foo [@field] : |
|
||||
| instance_variables.rb:17:6:17:8 | foo [@field] : | instance_variables.rb:5:5:7:7 | self in get_field [@field] : | instance_variables.rb:6:9:6:21 | return : | instance_variables.rb:17:6:17:18 | call to get_field |
|
||||
| instance_variables.rb:17:6:17:8 | foo [@field] : | instance_variables.rb:5:5:7:7 | self in get_field [@field] : | instance_variables.rb:6:9:6:21 | return : | instance_variables.rb:17:6:17:18 | call to get_field |
|
||||
| instance_variables.rb:20:15:20:23 | call to source : | instance_variables.rb:2:19:2:19 | x : | instance_variables.rb:3:9:3:14 | [post] self [@field] : | instance_variables.rb:20:1:20:3 | [post] bar [@field] : |
|
||||
| instance_variables.rb:21:6:21:8 | bar [@field] : | instance_variables.rb:8:5:10:7 | self in inc_field [@field] : | instance_variables.rb:8:5:10:7 | self in inc_field [@field] : | instance_variables.rb:21:6:21:18 | call to inc_field |
|
||||
| instance_variables.rb:21:6:21:8 | bar [@field] : | instance_variables.rb:8:5:10:7 | self in inc_field [@field] : | instance_variables.rb:9:9:9:14 | [post] self [@field] : | instance_variables.rb:21:6:21:18 | call to inc_field |
|
||||
#select
|
||||
| instance_variables.rb:12:10:12:13 | @foo | instance_variables.rb:11:12:11:22 | call to source : | instance_variables.rb:12:10:12:13 | @foo | $@ | instance_variables.rb:11:12:11:22 | call to source : | call to source : |
|
||||
| instance_variables.rb:17:6:17:18 | call to get_field | instance_variables.rb:16:15:16:24 | call to source : | instance_variables.rb:17:6:17:18 | call to get_field | $@ | instance_variables.rb:16:15:16:24 | call to source : | call to source : |
|
||||
| instance_variables.rb:21:6:21:18 | call to inc_field | instance_variables.rb:20:15:20:23 | call to source : | instance_variables.rb:21:6:21:18 | call to inc_field | $@ | instance_variables.rb:20:15:20:23 | call to source : | call to source : |
|
||||
|
||||
@@ -7,6 +7,6 @@ import codeql.ruby.DataFlow
|
||||
private import TestUtilities.InlineFlowTest
|
||||
import DataFlow::PathGraph
|
||||
|
||||
from DataFlow::PathNode source, DataFlow::PathNode sink, DefaultValueFlowConf conf
|
||||
from DataFlow::PathNode source, DataFlow::PathNode sink, DefaultTaintFlowConf conf
|
||||
where conf.hasFlowPath(source, sink)
|
||||
select sink, source, sink, "$@", source, source.toString()
|
||||
|
||||
@@ -14,4 +14,8 @@ class Foo
|
||||
end
|
||||
foo = Foo.new
|
||||
foo.set_field(source(42))
|
||||
sink(foo.get_field) # $ hasValueFlow=42
|
||||
sink(foo.get_field) # $ hasValueFlow=42
|
||||
|
||||
bar = Foo.new
|
||||
bar.set_field(source(5))
|
||||
sink(bar.inc_field) # $ hasTaintFlow=5
|
||||
Reference in New Issue
Block a user