mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
C++: Fixup queries to keep the old results.
This commit is contained in:
@@ -35,10 +35,15 @@ predicate isSource(FS::FlowSource source, string sourceType) { sourceType = sour
|
||||
|
||||
predicate isSink(DataFlow::Node sink, string kind) {
|
||||
exists(Expr use |
|
||||
use = sink.asExpr() and
|
||||
not use.getUnspecifiedType() instanceof PointerType and
|
||||
outOfBoundsExpr(use, kind) and
|
||||
not inSystemMacroExpansion(use)
|
||||
|
|
||||
if
|
||||
sink.asDefinition() instanceof CrementOperation or
|
||||
sink.asDefinition() instanceof AssignOperation
|
||||
then use = sink.asDefinition()
|
||||
else use = sink.asExpr()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ module TaintedAllocationSizeConfig implements DataFlow::ConfigSig {
|
||||
predicate isSink(DataFlow::Node sink) { allocSink(_, sink) }
|
||||
|
||||
predicate isBarrier(DataFlow::Node node) {
|
||||
exists(Expr e | e = node.asExpr() |
|
||||
exists(Expr e | e = [node.asExpr(), node.asDefinition()] |
|
||||
// There can be two separate reasons for `convertedExprMightOverflow` not holding:
|
||||
// 1. `e` really cannot overflow.
|
||||
// 2. `e` isn't analyzable.
|
||||
|
||||
Reference in New Issue
Block a user