Skip to content

Commit 860d0aa

Browse files
committed
C++: Remove single argument functions.
1 parent 539d671 commit 860d0aa

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

cpp/ql/src/semmle/code/cpp/ir/dataflow/DefaultTaintTracking.qll

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,16 @@ private predicate predictableInstruction(Instruction instr) {
2929
*
3030
* Note that the list itself is not very principled; it consists of all the
3131
* functions listed in the old security library's [default] `isPureFunction`
32-
* but not in the old taint tracking library's `returnArgument` predicate.
32+
* that have more than one argument, but are not in the old taint tracking
33+
* library's `returnArgument` predicate.
3334
*/
3435
predicate predictableOnlyFlow(string name) {
35-
name = "abs" or
36-
name = "atof" or
37-
name = "atoi" or
38-
name = "atol" or
39-
name = "atoll" or
40-
name = "labs" or
4136
name = "strcasestr" or
4237
name = "strchnul" or
4338
name = "strchr" or
4439
name = "strchrnul" or
4540
name = "strcmp" or
4641
name = "strcspn" or
47-
name = "strdup" or
48-
name = "strlen" or
4942
name = "strncmp" or
5043
name = "strndup" or
5144
name = "strnlen" or

cpp/ql/test/library-tests/dataflow/security-taint/tainted.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
| test.cpp:60:29:60:34 | call to getenv | test.cpp:60:18:60:25 | userName | |
3737
| test.cpp:60:29:60:34 | call to getenv | test.cpp:60:29:60:34 | call to getenv | |
3838
| test.cpp:60:29:60:34 | call to getenv | test.cpp:60:29:60:47 | (const char *)... | |
39+
| test.cpp:60:29:60:34 | call to getenv | test.cpp:64:10:64:14 | bytes | |
40+
| test.cpp:60:29:60:34 | call to getenv | test.cpp:64:18:64:23 | call to strlen | |
41+
| test.cpp:60:29:60:34 | call to getenv | test.cpp:64:18:64:37 | (int)... | |
42+
| test.cpp:60:29:60:34 | call to getenv | test.cpp:64:18:64:37 | ... + ... | |
3943
| test.cpp:60:29:60:34 | call to getenv | test.cpp:64:25:64:32 | userName | |
4044
| test.cpp:68:28:68:33 | call to getenv | test.cpp:11:20:11:21 | s1 | |
4145
| test.cpp:68:28:68:33 | call to getenv | test.cpp:11:36:11:37 | s2 | |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
| test5.cpp:10:9:10:15 | call to strtoul | $@ flows to here and is used in an expression which might overflow. | test5.cpp:9:7:9:9 | buf | User-provided value |
55
| 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 |
66
| 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 |
7+
| test.c:74:7:74:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:71:19:71:22 | argv | User-provided value |
8+
| test.c:84:7:84:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:81:19:81:22 | argv | User-provided value |
9+
| test.c:94:7:94:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:91:19:91:22 | argv | User-provided value |

0 commit comments

Comments
 (0)