mirror of
https://github.com/github/codeql.git
synced 2026-05-14 11:19:27 +02:00
C++: Disable results from the 5 queries.
This commit is contained in:
@@ -220,7 +220,8 @@ where
|
||||
// maximum (resp. minimum) number we can compute.
|
||||
overflows(me, t1) and
|
||||
// exclude cases where the expression type may not have been extracted accurately
|
||||
not me.getParent().(Call).getTarget().hasAmbiguousReturnType()
|
||||
not me.getParent().(Call).getTarget().hasAmbiguousReturnType() and
|
||||
none()
|
||||
select me,
|
||||
"Multiplication result may overflow '" + me.getType().toString() + "' before it is converted to '"
|
||||
+ me.getFullyConverted().getType().toString() + "'."
|
||||
|
||||
@@ -175,7 +175,8 @@ where
|
||||
not arg.getType().stripType().(RoutineType).getReturnType() instanceof ErroneousType and
|
||||
not arg.(Call).mayBeFromImplicitlyDeclaredFunction() and
|
||||
// Make sure that the format function definition is consistent
|
||||
count(ffc.getTarget().getFormatParameterIndex()) = 1
|
||||
count(ffc.getTarget().getFormatParameterIndex()) = 1 and
|
||||
none()
|
||||
select arg,
|
||||
"This format specifier for type '" + expected.getName() + "' does not match the argument type '" +
|
||||
actual.getUnspecifiedType().getName() + "'."
|
||||
|
||||
@@ -45,5 +45,6 @@ where
|
||||
sameLocation(fdeIm, fc) and
|
||||
not mistypedFunctionArguments(fc, _, _) and
|
||||
not tooFewArguments(fc, _) and
|
||||
not tooManyArguments(fc, _)
|
||||
not tooManyArguments(fc, _) and
|
||||
none()
|
||||
select fc, "Function call implicitly declares '" + fdeIm.getName() + "'."
|
||||
|
||||
@@ -73,7 +73,8 @@ where
|
||||
not getComparisonSize(large.(RShiftExpr).getLeftOperand().getExplicitlyConverted()) <=
|
||||
getComparisonSize(small) and
|
||||
// ignore loop-invariant smaller variables
|
||||
loopVariant(small, l)
|
||||
loopVariant(small, l) and
|
||||
none()
|
||||
select rel,
|
||||
"Comparison between $@ of type " + small.getType().getName() + " and $@ of wider type " +
|
||||
large.getType().getName() + ".", friendlyLoc(small), small.toString(), friendlyLoc(large),
|
||||
|
||||
@@ -29,7 +29,8 @@ where
|
||||
// the pointer expression to be `char*` or `void*`. Otherwise it
|
||||
// is probably a mistake.
|
||||
addWithSizeof(e, sizeofExpr, _) and
|
||||
not isCharSzPtrExpr(e)
|
||||
not isCharSzPtrExpr(e) and
|
||||
none()
|
||||
select sizeofExpr,
|
||||
"Suspicious sizeof offset in a pointer arithmetic expression. The type of the pointer is $@.",
|
||||
e.getFullyConverted().getType() as t, t.toString()
|
||||
|
||||
Reference in New Issue
Block a user