Skip to content

Commit 86822f6

Browse files
committed
C++: Exclude pointer results from cpp/integer-overflow-tainted.
1 parent 3cf4f1f commit 86822f6

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

cpp/ql/src/Security/CWE/CWE-190/IntegerOverflowTainted.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ predicate outOfBoundsExpr(Expr expr, string kind) {
2828

2929
from Expr use, Expr origin, string kind
3030
where
31+
not use.getUnspecifiedType() instanceof PointerType and
3132
outOfBoundsExpr(use, kind) and
3233
tainted(origin, use) and
3334
origin != use and

cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/IntegerOverflowTainted.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
| test6.cpp:16:15:16:15 | s | $@ flows to here and is used in an expression which might overflow. | test6.cpp:39:23:39:24 | & ... | User-provided value |
1313
| test6.cpp:30:16:30:16 | s | $@ flows to here and is used in an expression which might overflow. | test6.cpp:39:23:39:24 | & ... | User-provided value |
1414
| test.c:14:15:14:35 | ... * ... | $@ flows to here and is used in an expression which might overflow. | test.c:11:29:11:32 | argv | User-provided value |
15-
| test.c:25:5:25:9 | ... ++ | $@ flows to here and is used in an expression which might overflow. | test.c:23:15:23:18 | argv | User-provided value |
1615
| test.c:44:7:44:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:41:17:41:20 | argv | User-provided value |
1716
| test.c:54:7:54:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:51:17:51:20 | argv | User-provided value |

0 commit comments

Comments
 (0)