mirror of
https://github.com/github/codeql.git
synced 2026-03-29 19:58:17 +02:00
C++: Fix false positive by restricting _both_ the old (unconverted) expression _and_ all of the conversions.
This commit is contained in:
@@ -49,6 +49,9 @@ where
|
||||
small = rel.getLesserOperand() and
|
||||
large = rel.getGreaterOperand() and
|
||||
rel = l.getCondition().getAChild*() and
|
||||
forall(Expr conv | conv = large.getConversion*() |
|
||||
upperBound(conv).log2() > getComparisonSize(small) * 8
|
||||
) and
|
||||
upperBound(large.getFullyConverted()).log2() > getComparisonSize(small) * 8 and
|
||||
// Ignore cases where the smaller type is int or larger
|
||||
// These are still bugs, but you should need a very large string or array to
|
||||
|
||||
Reference in New Issue
Block a user