Skip to content

Commit 0935c5a

Browse files
authored
Update DeclarationOfVariableWithUnnecessarilyWideScope.ql
1 parent 8c3980d commit 0935c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-1126/DeclarationOfVariableWithUnnecessarilyWideScope.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DangerousWhileLoop extends WhileStmt {
2626
exp = this.getCondition().getAChild*() and
2727
not exp instanceof PointerFieldAccess and
2828
not exp instanceof ValueFieldAccess and
29-
exp.toString() = dl.getName() and
29+
exp.(VariableAccess).getTarget().getName() = dl.getName() and
3030
not exp.getParent*() instanceof CrementOperation and
3131
not exp.getParent*() instanceof Assignment and
3232
not exp.getParent*() instanceof FunctionCall

0 commit comments

Comments
 (0)