Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f1e070

Browse files
committed
second test of taint steps
1 parent 649df1d commit 0f1e070

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

python/ql/test/library-tests/frameworks/data/test.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ taintFlow
55
| test.py:10:8:10:22 | ControlFlowNode for Attribute() | test.py:10:8:10:22 | ControlFlowNode for Attribute() |
66
| test.py:11:8:11:30 | ControlFlowNode for Attribute() | test.py:11:8:11:30 | ControlFlowNode for Attribute() |
77
| test.py:71:28:71:38 | ControlFlowNode for getSource() | test.py:71:8:71:39 | ControlFlowNode for Attribute() |
8+
| test.py:75:5:75:15 | ControlFlowNode for getSource() | test.py:76:22:76:22 | ControlFlowNode for x |
9+
| test.py:75:5:75:15 | ControlFlowNode for getSource() | test.py:77:22:77:22 | ControlFlowNode for y |
810
isSink
911
| test.py:4:8:4:8 | ControlFlowNode for x | test-sink |
1012
| test.py:7:17:7:17 | ControlFlowNode for x | test-sink |
@@ -31,6 +33,9 @@ isSink
3133
| test.py:67:34:67:44 | ControlFlowNode for secondNamed | test-source |
3234
| test.py:71:8:71:39 | ControlFlowNode for Attribute() | test-sink |
3335
| test.py:72:8:72:47 | ControlFlowNode for Attribute() | test-sink |
36+
| test.py:76:22:76:22 | ControlFlowNode for x | test-sink |
37+
| test.py:77:22:77:22 | ControlFlowNode for y | test-sink |
38+
| test.py:78:22:78:22 | ControlFlowNode for z | test-sink |
3439
isSource
3540
| test.py:3:5:3:15 | ControlFlowNode for getSource() | test-source |
3641
| test.py:9:8:9:14 | ControlFlowNode for alias() | test-source |
@@ -59,6 +64,7 @@ isSource
5964
| test.py:63:54:63:57 | ControlFlowNode for arg5 | test-source |
6065
| test.py:71:28:71:38 | ControlFlowNode for getSource() | test-source |
6166
| test.py:72:36:72:46 | ControlFlowNode for getSource() | test-source |
67+
| test.py:75:5:75:15 | ControlFlowNode for getSource() | test-source |
6268
syntaxErrors
6369
| Member[foo |
6470
| Member[foo] .Member[bar] |

python/ql/test/library-tests/frameworks/data/test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,11 @@ def secondAndAfter(self, arg1, arg2, arg3, arg4, arg5):
6969
from testlib import Steps
7070

7171
mySink(Steps.preserveTaint(getSource())) # FLOW
72-
mySink(Steps.preserveTaint("safe", getSource())) # NO FLOW
72+
mySink(Steps.preserveTaint("safe", getSource())) # NO FLOW
73+
74+
Steps.taintIntoCallback(
75+
getSource(),
76+
lambda x: mySink(x), # FLOW
77+
lambda y: mySink(y), # FLOW
78+
lambda z: mySink(z) # NO FLOW
79+
)

python/ql/test/library-tests/frameworks/data/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Steps extends ModelInput::SummaryModelCsv {
1111
row =
1212
[
1313
"testlib;;Member[Steps].Member[preserveTaint];Argument[0];ReturnValue;taint",
14-
// "testlib;;Member[Steps].Member[taintIntoCallback];Argument[0];Argument[1..2].Parameter[0];taint",
14+
"testlib;;Member[Steps].Member[taintIntoCallback];Argument[0];Argument[1..2].Parameter[0];taint",
1515
// "testlib;;Member[Steps].Member[taintIntoCallbackThis];Argument[0];Argument[1..2].Parameter[this];taint",
1616
// "testlib;;Member[Steps].Member[preserveArgZeroAndTwo];Argument[0,2];ReturnValue;taint",
1717
// "testlib;;Member[Steps].Member[preserveAllButFirstArgument];Argument[1..];ReturnValue;taint",

0 commit comments

Comments
 (0)