Skip to content

Commit 0837e40

Browse files
committed
C++: Add failing test.
1 parent 91d224e commit 0837e40

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6643,6 +6643,8 @@ WARNING: Module TaintTracking has been deprecated and may be removed in future (
66436643
| taint.cpp:729:27:729:32 | endptr | taint.cpp:729:26:729:32 | & ... | |
66446644
| taint.cpp:731:7:731:12 | ref arg endptr | taint.cpp:732:8:732:13 | endptr | |
66456645
| taint.cpp:732:8:732:13 | endptr | taint.cpp:732:7:732:13 | * ... | TAINT |
6646+
| taint.cpp:738:17:738:31 | call to indirect_source | taint.cpp:739:30:739:35 | source | |
6647+
| taint.cpp:739:22:739:28 | call to realloc | taint.cpp:740:7:740:10 | dest | |
66466648
| vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | |
66476649
| vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | |
66486650
| 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,4 +730,12 @@ void test_strtol(char *source) {
730730
sink(l); // $ ast,ir
731731
sink(endptr); // $ ast,ir
732732
sink(*endptr); // $ ast,ir
733+
}
734+
735+
void *realloc(void *, size_t);
736+
737+
void test_realloc() {
738+
char *source = indirect_source();
739+
char *dest = (char*)realloc(source, 16);
740+
sink(dest); // $ MISSING: ast,ir
733741
}

0 commit comments

Comments
 (0)