Skip to content

Commit 11a0785

Browse files
committed
C++: Fixup two queries which assumes that a guard is always an expression.
1 parent 0c8e8ce commit 11a0785

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cpp/ql/src/Security/CWE/CWE-295/SSLResultConflation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module VerifyResultConfig implements DataFlow::ConfigSig {
2929
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof SslGetVerifyResultCall }
3030

3131
predicate isSink(DataFlow::Node sink) {
32-
exists(GuardCondition guard | guard.getAChild*() = sink.asExpr())
32+
exists(GuardCondition guard | guard.(Expr).getAChild*() = sink.asExpr())
3333
}
3434

3535
predicate observeDiffInformedIncrementalMode() { any() }

cpp/ql/src/Security/CWE/CWE-367/TOCTOUFilesystemRace.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ predicate checksPath(Expr check, Expr checkPath) {
115115

116116
pragma[nomagic]
117117
predicate checkPathControlsUse(Expr check, Expr checkPath, Expr use) {
118-
exists(GuardCondition guard | referenceTo(check, guard.getAChild*()) |
118+
exists(GuardCondition guard | referenceTo(check, guard.(Expr).getAChild*()) |
119119
guard.controls(use.getBasicBlock(), _)
120120
) and
121121
checksPath(pragma[only_bind_into](check), checkPath)
122122
}
123123

124124
pragma[nomagic]
125125
predicate fileNameOperationControlsUse(Expr check, Expr checkPath, Expr use) {
126-
exists(GuardCondition guard | referenceTo(check, guard.getAChild*()) |
126+
exists(GuardCondition guard | referenceTo(check, guard.(Expr).getAChild*()) |
127127
guard.controls(use.getBasicBlock(), _)
128128
) and
129129
pragma[only_bind_into](check) = filenameOperation(checkPath)

0 commit comments

Comments
 (0)