Skip to content

Commit b9823cf

Browse files
committed
fix ql/could-be-cast
1 parent 0d4419d commit b9823cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-125/DangerousWorksWithMultibyteOrWideCharacters.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ predicate findUseCharacterConversion(Expr exp, string msg) {
6767
exists(FunctionCall fc |
6868
fc = exp and
6969
(
70-
exists(Loop lptmp | lptmp = fc.getEnclosingStmt().getParentStmt*()) and
70+
fc.getEnclosingStmt().getParentStmt*() instanceof Loop and
7171
fc.getTarget().hasName(["mbtowc", "mbrtowc", "_mbtowc_l"]) and
7272
not fc.getArgument(0).isConstant() and
7373
not fc.getArgument(1).isConstant() and

cpp/ql/src/experimental/Security/CWE/CWE-190/DangerousUseOfTransformationAfterOperation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ predicate signSmallerWithEqualSizes(MulExpr mexp) {
7575
ae.getRValue().getUnderlyingType().(IntegralType).isUnsigned() and
7676
ae.getLValue().getUnderlyingType().(IntegralType).isSigned() and
7777
(
78-
not exists(DivExpr de | mexp.getParent*() = de)
78+
not mexp.getParent*() instanceof DivExpr
7979
or
8080
exists(DivExpr de, Expr ec |
8181
e2.isConstant() and

0 commit comments

Comments
 (0)