mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
fix ql/could-be-cast
This commit is contained in:
@@ -67,7 +67,7 @@ predicate findUseCharacterConversion(Expr exp, string msg) {
|
||||
exists(FunctionCall fc |
|
||||
fc = exp and
|
||||
(
|
||||
exists(Loop lptmp | lptmp = fc.getEnclosingStmt().getParentStmt*()) and
|
||||
fc.getEnclosingStmt().getParentStmt*() instanceof Loop and
|
||||
fc.getTarget().hasName(["mbtowc", "mbrtowc", "_mbtowc_l"]) and
|
||||
not fc.getArgument(0).isConstant() and
|
||||
not fc.getArgument(1).isConstant() and
|
||||
|
||||
@@ -75,7 +75,7 @@ predicate signSmallerWithEqualSizes(MulExpr mexp) {
|
||||
ae.getRValue().getUnderlyingType().(IntegralType).isUnsigned() and
|
||||
ae.getLValue().getUnderlyingType().(IntegralType).isSigned() and
|
||||
(
|
||||
not exists(DivExpr de | mexp.getParent*() = de)
|
||||
not mexp.getParent*() instanceof DivExpr
|
||||
or
|
||||
exists(DivExpr de, Expr ec |
|
||||
e2.isConstant() and
|
||||
|
||||
Reference in New Issue
Block a user