Skip to content

Commit a646749

Browse files
authored
Merge pull request github#13318 from MathiasVP/exclude-std-in-constant-size-array-off-by-one
C++: Exclude `StdNamespace` sources in `cpp/constant-size-array-off-by-one`
2 parents 60a5ef7 + 65eebf1 commit a646749

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-193/ConstantSizeArrayOffByOne.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ predicate arrayTypeHasSizes(ArrayType arr, int baseTypeSize, int arraySize) {
8787
predicate pointerArithOverflow0(
8888
PointerArithmeticInstruction pai, Field f, int size, int bound, int delta
8989
) {
90+
not f.getNamespace() instanceof StdNamespace and
9091
arrayTypeHasSizes(f.getUnspecifiedType(), pai.getElementSize(), size) and
9192
semBounded(getSemanticExpr(pai.getRight()), any(SemZeroBound b), bound, true, _) and
9293
delta = bound - size and

0 commit comments

Comments
 (0)