Use EqualityTest for either value or ref comparions, and ReferenceEqualityTest for strictly ref comparison.

This commit is contained in:
Chris Smowton
2022-02-07 16:56:45 +00:00
committed by Ian Lynagh
parent f95effcf82
commit 7dec3f4835
26 changed files with 47 additions and 47 deletions

View File

@@ -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,

View File

@@ -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())
)