Skip to content

Commit e46ae9b

Browse files
committed
Python: Move some query predicates to debug
1 parent 839cd82 commit e46ae9b

File tree

3 files changed

+18
-31
lines changed

3 files changed

+18
-31
lines changed

python/ql/test/experimental/dataflow/tainttracking/customSanitizer/TestTaint.expected

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,3 @@ isSanitizer
99
| TestTaintTrackingConfiguration | test.py:50:10:50:29 | ControlFlowNode for emulated_escaping() |
1010
isSanitizerGuard
1111
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() |
12-
sanitizerGuardControls
13-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:36:9:36:26 | ControlFlowNode for ensure_not_tainted | true |
14-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:36:9:36:29 | ControlFlowNode for ensure_not_tainted() | true |
15-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:36:28:36:28 | ControlFlowNode for s | true |
16-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:37:9:37:9 | ControlFlowNode for s | true |
17-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:37:13:37:26 | ControlFlowNode for TAINTED_STRING | true |
18-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:38:9:38:22 | ControlFlowNode for ensure_tainted | true |
19-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:38:9:38:25 | ControlFlowNode for ensure_tainted() | true |
20-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:38:24:38:24 | ControlFlowNode for s | true |
21-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:40:9:40:22 | ControlFlowNode for ensure_tainted | false |
22-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:40:9:40:25 | ControlFlowNode for ensure_tainted() | false |
23-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:40:24:40:24 | ControlFlowNode for s | false |
24-
sanitizerGuardedNode
25-
| TestTaintTrackingConfiguration | test.py:35:8:35:26 | ControlFlowNode for emulated_is_safe() | test.py:36:28:36:28 | ControlFlowNode for s |

python/ql/test/experimental/dataflow/tainttracking/customSanitizer/TestTaint.ql

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,3 @@ query predicate isSanitizerGuard(TestTaintTrackingConfiguration conf, DataFlow::
3131
exists(guard.getLocation().getFile().getRelativePath()) and
3232
conf.isSanitizerGuard(guard)
3333
}
34-
35-
query predicate sanitizerGuardControls(
36-
TestTaintTrackingConfiguration conf, DataFlow::BarrierGuard guard, ControlFlowNode node,
37-
boolean branch
38-
) {
39-
exists(guard.getLocation().getFile().getRelativePath()) and
40-
conf.isSanitizerGuard(guard) and
41-
guard.controlsBlock(node.getBasicBlock(), branch)
42-
}
43-
44-
query predicate sanitizerGuardedNode(
45-
TestTaintTrackingConfiguration conf, DataFlow::BarrierGuard guard, DataFlow::ExprNode node
46-
) {
47-
exists(guard.getLocation().getFile().getRelativePath()) and
48-
conf.isSanitizerGuard(guard) and
49-
node = guard.getAGuardedNode()
50-
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import experimental.dataflow.tainttracking.TestTaintLib
2+
3+
query predicate sanitizerGuardControls(
4+
TestTaintTrackingConfiguration conf, DataFlow::BarrierGuard guard, ControlFlowNode node,
5+
boolean branch
6+
) {
7+
exists(guard.getLocation().getFile().getRelativePath()) and
8+
conf.isSanitizerGuard(guard) and
9+
guard.controlsBlock(node.getBasicBlock(), branch)
10+
}
11+
12+
query predicate sanitizerGuardedNode(
13+
TestTaintTrackingConfiguration conf, DataFlow::BarrierGuard guard, DataFlow::ExprNode node
14+
) {
15+
exists(guard.getLocation().getFile().getRelativePath()) and
16+
conf.isSanitizerGuard(guard) and
17+
node = guard.getAGuardedNode()
18+
}

0 commit comments

Comments
 (0)