Skip to content

Commit f00b29d

Browse files
committed
C++: The small-string optimization commonly used inside 'std::string' is causing a lot of FPs. Let's exclude this for now to reduce the number of results for this query.
1 parent 2afda5f commit f00b29d

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)