Ruby: enable taint checking for array-flow test

This commit is contained in:
Nick Rolfe
2022-01-27 13:08:16 +00:00
parent c0e1384f4a
commit 8248a942ce
3 changed files with 3376 additions and 16 deletions

View File

@@ -6,11 +6,6 @@ import ruby
import TestUtilities.InlineFlowTest
import PathGraph
// TODO enable taint flow for this test
class HasFlowTest extends InlineFlowTest {
override DataFlow::Configuration getTaintFlowConfig() { none() }
}
from DataFlow::PathNode source, DataFlow::PathNode sink, DefaultValueFlowConf conf
where conf.hasFlowPath(source, sink)
select sink, source, sink, "$@", source, source.toString()

View File

@@ -1,8 +1,8 @@
def m0(i)
a = *source(0)
sink(a[0]) # $ hasValueFlow=0
a = *source(0.1)
sink(a[0]) # $ hasValueFlow=0.1
sink(a[1])
sink(a[i]) # $ hasValueFlow=0
sink(a[i]) # $ hasValueFlow=0.1
end
def m1(i)
@@ -815,7 +815,7 @@ end
def m86
a = [0, 1, source(86)]
b = a.pack 'ccc'
sink b # TODO hasTaintFlow=86
sink b # $ hasTaintFlow=86
end
def m87