mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
C++: respond to PR comments
This commit is contained in:
@@ -52,10 +52,6 @@ module ProductFlow {
|
|||||||
override predicate isSink(DataFlow::Node sink) {
|
override predicate isSink(DataFlow::Node sink) {
|
||||||
exists(Configuration conf | conf.isSinkPair(_, sink))
|
exists(Configuration conf | conf.isSinkPair(_, sink))
|
||||||
}
|
}
|
||||||
|
|
||||||
override int explorationLimit() {
|
|
||||||
result = 10
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
predicate reachablePair1(
|
predicate reachablePair1(
|
||||||
@@ -67,7 +63,7 @@ module ProductFlow {
|
|||||||
exists(DataFlow::PathNode mid1 |
|
exists(DataFlow::PathNode mid1 |
|
||||||
reachablePair1(conf, source1, source2, mid1, node2) and
|
reachablePair1(conf, source1, source2, mid1, node2) and
|
||||||
mid1.getASuccessor() = node1 and
|
mid1.getASuccessor() = node1 and
|
||||||
mid1.getNode().getFunction() = node1.getNode().getFunction()
|
mid1.getNode().getEnclosingCallable() = node1.getNode().getEnclosingCallable()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +76,7 @@ module ProductFlow {
|
|||||||
exists(DataFlow2::PathNode mid2 |
|
exists(DataFlow2::PathNode mid2 |
|
||||||
reachablePair2(conf, source1, source2, node1, mid2) and
|
reachablePair2(conf, source1, source2, node1, mid2) and
|
||||||
mid2.getASuccessor() = node2 and
|
mid2.getASuccessor() = node2 and
|
||||||
mid2.getNode().getFunction() = node2.getNode().getFunction()
|
mid2.getNode().getEnclosingCallable() = node2.getNode().getEnclosingCallable()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,10 +88,10 @@ module ProductFlow {
|
|||||||
reachablePair2(conf, source1, source2, mid1, mid2) and
|
reachablePair2(conf, source1, source2, mid1, mid2) and
|
||||||
mid1.getASuccessor() = node1 and
|
mid1.getASuccessor() = node1 and
|
||||||
mid2.getASuccessor() = node2 and
|
mid2.getASuccessor() = node2 and
|
||||||
mid1.getNode().getFunction() = funcMid and // TODO: recursive function weirdness?
|
mid1.getNode().getEnclosingCallable() = funcMid and // TODO: recursive function weirdness?
|
||||||
mid2.getNode().getFunction() = funcMid and
|
mid2.getNode().getEnclosingCallable() = funcMid and
|
||||||
node1.getNode().getFunction() = func and
|
node1.getNode().getEnclosingCallable() = func and
|
||||||
node2.getNode().getFunction() = func and
|
node2.getNode().getEnclosingCallable() = func and
|
||||||
funcMid != func
|
funcMid != func
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ class StringSizeConfiguration extends ProductFlow::Configuration {
|
|||||||
|
|
||||||
override predicate isSourcePair(DataFlow::Node bufSource, DataFlow::Node sizeSource) {
|
override predicate isSourcePair(DataFlow::Node bufSource, DataFlow::Node sizeSource) {
|
||||||
exists(
|
exists(
|
||||||
GVN sizeGVN // TODO: use-use flow instead of GVN
|
GVN sizeGvn // TODO: use-use flow instead of GVN
|
||||||
|
|
|
|
||||||
bufSource.asConvertedExpr().(AllocationExpr).getSizeExpr() = sizeGVN.getAnExpr() and
|
bufSource.asConvertedExpr().(AllocationExpr).getSizeExpr() = sizeGvn.getAnExpr() and
|
||||||
sizeSource.asConvertedExpr() = sizeGVN.getAnExpr()
|
sizeSource.asConvertedExpr() = sizeGvn.getAnExpr()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,6 +26,9 @@ class StringSizeConfiguration extends ProductFlow::Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
from StringSizeConfiguration conf, DataFlow::PathNode source1, DataFlow2::PathNode source2, DataFlow::PathNode sink1, DataFlow2::PathNode sink2
|
// we don't actually check correctness yet. Right now the query just finds relevant source/sink pairs.
|
||||||
|
from
|
||||||
|
StringSizeConfiguration conf, DataFlow::PathNode source1, DataFlow2::PathNode source2,
|
||||||
|
DataFlow::PathNode sink1, DataFlow2::PathNode sink2
|
||||||
where conf.hasFlowPath(source1, source2, sink1, sink2)
|
where conf.hasFlowPath(source1, source2, sink1, sink2)
|
||||||
select source1, source2, sink1, sink2
|
select source1, source2, sink1, sink2
|
||||||
|
|||||||
Reference in New Issue
Block a user