Skip to content

Commit e468344

Browse files
committed
C++: Add failing test.
1 parent 8bf8888 commit e468344

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6629,6 +6629,19 @@ WARNING: Module TaintTracking has been deprecated and may be removed in future (
66296629
| taint.cpp:720:27:720:32 | source | taint.cpp:720:20:720:25 | call to strtok | TAINT |
66306630
| taint.cpp:721:8:721:16 | tokenized | taint.cpp:721:7:721:16 | * ... | TAINT |
66316631
| taint.cpp:722:8:722:12 | delim | taint.cpp:722:7:722:12 | * ... | TAINT |
6632+
| taint.cpp:727:24:727:29 | source | taint.cpp:727:24:727:29 | source | |
6633+
| taint.cpp:727:24:727:29 | source | taint.cpp:729:18:729:23 | source | |
6634+
| taint.cpp:728:17:728:23 | 0 | taint.cpp:729:27:729:32 | endptr | |
6635+
| taint.cpp:728:17:728:23 | 0 | taint.cpp:731:7:731:12 | endptr | |
6636+
| taint.cpp:728:17:728:23 | 0 | taint.cpp:732:8:732:13 | endptr | |
6637+
| taint.cpp:729:11:729:16 | call to strtol | taint.cpp:730:7:730:7 | l | |
6638+
| taint.cpp:729:18:729:23 | source | taint.cpp:729:11:729:16 | call to strtol | TAINT |
6639+
| taint.cpp:729:26:729:32 | ref arg & ... | taint.cpp:729:27:729:32 | endptr [inner post update] | |
6640+
| taint.cpp:729:26:729:32 | ref arg & ... | taint.cpp:731:7:731:12 | endptr | |
6641+
| taint.cpp:729:26:729:32 | ref arg & ... | taint.cpp:732:8:732:13 | endptr | |
6642+
| taint.cpp:729:27:729:32 | endptr | taint.cpp:729:26:729:32 | & ... | |
6643+
| taint.cpp:731:7:731:12 | ref arg endptr | taint.cpp:732:8:732:13 | endptr | |
6644+
| taint.cpp:732:8:732:13 | endptr | taint.cpp:732:7:732:13 | * ... | TAINT |
66326645
| vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | |
66336646
| vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | |
66346647
| vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | |

cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,4 +720,14 @@ void test_strtok_indirect() {
720720
char* tokenized = strtok(source, delim);
721721
sink(*tokenized); // $ ir MISSING: ast
722722
sink(*delim);
723+
}
724+
725+
long int strtol(const char*, char**, int);
726+
727+
void test_strtol(char *source) {
728+
char* endptr = nullptr;
729+
long l = strtol(source, &endptr, 10);
730+
sink(l); // $ ast,ir
731+
sink(endptr); // $ MISSING: ast,ir
732+
sink(*endptr); // $ MISSING: ast,ir
723733
}

0 commit comments

Comments
 (0)