Skip to content

Commit 6508ccc

Browse files
committed
debug
1 parent 5a78f7d commit 6508ccc

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ private predicate compatibleTypes0(DataFlowType t1, DataFlowType t2) {
408408
erasedHaveIntersection(t1, t2)
409409
}
410410

411+
private predicate sdef(DataFlowType t1, DataFlowType t2) {
412+
t1.toString() = "String" and
413+
t2.toString() = "ArrayList" and
414+
compatibleTypes(t1, t2)
415+
}
416+
411417
/**
412418
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
413419
* a node of type `t1` to a node of type `t2`.

java/ql/lib/semmle/code/java/security/TaintedPathQuery.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ module TaintedPathConfig implements DataFlow::ConfigSig {
6060
predicate isBarrier(DataFlow::Node sanitizer) {
6161
sanitizer instanceof SimpleTypeSanitizer or
6262
sanitizer instanceof PathInjectionSanitizer or
63-
sanitizer.getLocation().getFile().getBaseName() = "BaseObject.java"
63+
sanitizer.getLocation().getFile().getBaseName() =
64+
["BaseObject.java", "SimpleNode.java", "Context.java"]
6465
}
6566

6667
predicate isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2) {

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,20 +3202,32 @@ module MakeImpl<InputSig Lang> {
32023202
NodeEx node, DataFlowType t0, DataFlowType t, boolean inSummaryCtx
32033203
) {
32043204
exists(inSummaryCtx) and
3205-
if node instanceof RetNodeEx and inSummaryCtx = true
3206-
then t = node.getDataFlowType() and compatibleTypes(t, t0)
3207-
else
3208-
if castingNodeEx(node)
3209-
then
3210-
exists(DataFlowType nt | nt = node.getDataFlowType() |
3211-
if inSummaryCtx = false and typeStrongerThan(nt, t0)
3212-
then t = nt
3213-
else (
3214-
compatibleTypes(nt, t0) and
3215-
if inSummaryCtx = true and node instanceof ParamNodeEx then t = nt else t = t0
3216-
)
3205+
// if node instanceof RetNodeEx and inSummaryCtx = true
3206+
// then t = node.getDataFlowType() and compatibleTypes(t, t0)
3207+
// else
3208+
// if castingNodeEx(node)
3209+
// then
3210+
// exists(DataFlowType nt | nt = node.getDataFlowType() |
3211+
// if inSummaryCtx = false and typeStrongerThan(nt, t0)
3212+
// then t = nt
3213+
// else (
3214+
// compatibleTypes(nt, t0) and
3215+
// if inSummaryCtx = true and node instanceof ParamNodeEx then t = nt else t = t0
3216+
// )
3217+
// )
3218+
// else t = t0
3219+
if castingNodeEx(node)
3220+
then
3221+
exists(DataFlowType nt | nt = node.getDataFlowType() |
3222+
if inSummaryCtx = false and typeStrongerThan(nt, t0)
3223+
then t = nt
3224+
else (
3225+
compatibleTypes(nt, t0) and
3226+
// t = t0
3227+
if inSummaryCtx = true and node instanceof ParamNodeEx then t = nt else t = t0
32173228
)
3218-
else t = t0
3229+
)
3230+
else t = t0
32193231
}
32203232

32213233
private module Stage3_5Param implements MkStage<Stage3>::StageParam {

0 commit comments

Comments
 (0)