Merge pull request #682 from geoffw0/suspiciousaddsizeof

CPP: Fix false positive in SuspiciousAddWithSizeof.ql
This commit is contained in:
Jonas Jensen
2019-01-21 09:06:18 +01:00
committed by GitHub
4 changed files with 34 additions and 3 deletions

View File

@@ -15,9 +15,9 @@ import IncorrectPointerScalingCommon
private predicate isCharSzPtrExpr(Expr e) {
exists (PointerType pt
| pt = e.getFullyConverted().getUnderlyingType()
| pt.getBaseType().getUnspecifiedType() instanceof CharType
or pt.getBaseType().getUnspecifiedType() instanceof VoidType)
| pt = e.getFullyConverted().getType().getUnspecifiedType()
| pt.getBaseType() instanceof CharType
or pt.getBaseType() instanceof VoidType)
}
from Expr sizeofExpr, Expr e