mirror of
https://github.com/github/codeql.git
synced 2026-06-18 19:31:11 +02:00
Use EqualityTest for either value or ref comparions, and ReferenceEqualityTest for strictly ref comparison.
This commit is contained in:
committed by
Ian Lynagh
parent
f95effcf82
commit
7dec3f4835
@@ -16,7 +16,7 @@ private predicate inWeakCheck(Expr e) {
|
||||
)
|
||||
or
|
||||
// Checking against `null` has no bearing on path traversal.
|
||||
exists(AnyEqualityTest b | b.getAnOperand() = e | b.getAnOperand() instanceof NullLiteral)
|
||||
exists(EqualityTest b | b.getAnOperand() = e | b.getAnOperand() instanceof NullLiteral)
|
||||
}
|
||||
|
||||
// Ignore cases where the variable has been checked somehow,
|
||||
|
||||
@@ -46,7 +46,7 @@ predicate boundedRead(RValue read) {
|
||||
}
|
||||
|
||||
predicate castCheck(RValue read) {
|
||||
exists(AnyEqualityTest eq, CastExpr cast |
|
||||
exists(EqualityTest eq, CastExpr cast |
|
||||
cast.getExpr() = read and
|
||||
eq.hasOperands(cast, read.getVariable().getAnAccess())
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user