Skip to content

Commit 399ac1f

Browse files
committed
CPP: Rename 'getAssertedFalseCondition' to something less misleading.
1 parent 1fe5a9e commit 399ac1f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cpp/ql/src/Security/CWE/CWE-457/InitializationFunctions.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ class ParameterNullCheck extends ParameterCheck {
8989
(
9090
va = this.(NotExpr).getOperand() or
9191
va = any(EQExpr eq | eq = this and eq.getAnOperand().getValue() = "0").getAnOperand() or
92-
va = getAssertedFalseCondition(this) or
92+
va = getCheckedFalseCondition(this) or
9393
va = any(NEExpr eq |
94-
eq = getAssertedFalseCondition(this) and eq.getAnOperand().getValue() = "0"
94+
eq = getCheckedFalseCondition(this) and eq.getAnOperand().getValue() = "0"
9595
).getAnOperand()
9696
)
9797
or
@@ -101,7 +101,7 @@ class ParameterNullCheck extends ParameterCheck {
101101
va = this or
102102
va = any(NEExpr eq | eq = this and eq.getAnOperand().getValue() = "0").getAnOperand() or
103103
va = any(EQExpr eq |
104-
eq = getAssertedFalseCondition(this) and eq.getAnOperand().getValue() = "0"
104+
eq = getCheckedFalseCondition(this) and eq.getAnOperand().getValue() = "0"
105105
).getAnOperand()
106106
)
107107
)
@@ -669,15 +669,15 @@ FieldAccess getAFieldAccess(Variable v) {
669669
}
670670

671671
/**
672-
* Gets a condition which is asserted to be false by the given `ne` expression, according to this pattern:
672+
* Gets a condition which is checked to be false by the given `ne` expression, according to this pattern:
673673
* ```
674674
* int a = !!result;
675675
* if (!a) { // <- ne
676676
* ....
677677
* }
678678
* ```
679679
*/
680-
Expr getAssertedFalseCondition(NotExpr ne) {
680+
private Expr getCheckedFalseCondition(NotExpr ne) {
681681
exists(LocalVariable v |
682682
result = v.getInitializer().getExpr().(NotExpr).getOperand().(NotExpr).getOperand() and
683683
ne.getOperand() = v.getAnAccess() and

0 commit comments

Comments
 (0)