Skip to content

Commit 318e75c

Browse files
committed
Changing name of predicate to be clearer, and removing an unused parameter.
1 parent c91f7f4 commit 318e75c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class UnicodeMacroInvocation extends MacroInvocation {
7878
* the flag would indicate if UNICODE typing is set correctly to allow
7979
* or disallow a widening cast.
8080
*/
81-
predicate isLikelyDynamicChecked(Expr e, GuardCondition gc) {
81+
predicate isLikelyDynamicallyChecked(Expr e) {
8282
e.getType() instanceof UnicodeMacroDependentWidthType and
83-
exists(BitwiseAndExpr bai, UnicodeMacroInvocation umi | bai.getAnOperand() = umi.getExpr() |
83+
exists(GuardCondition gc, BitwiseAndExpr bai, UnicodeMacroInvocation umi | bai.getAnOperand() = umi.getExpr() |
8484
// bai == 0 is false when reaching `e.getBasicBlock()`.
8585
// That is, bai != 0 when reaching `e.getBasicBlock()`.
8686
gc.ensuresEq(bai, 0, e.getBasicBlock(), false)
@@ -106,7 +106,7 @@ where
106106
// Avoid cases where the cast is guarded by a check to determine if
107107
// unicode encoding is enabled in such a way to disallow the dangerous cast
108108
// at runtime.
109-
not isLikelyDynamicChecked(e1, _)
109+
not isLikelyDynamicallyChecked(e1)
110110
select e1,
111111
"Conversion from " + e1.getType().toString() + " to " + e2.getType().toString() +
112112
". Use of invalid string can lead to undefined behavior."

0 commit comments

Comments
 (0)