diff --git a/cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected b/cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected index 9abb8ec8609..93792f406aa 100644 --- a/cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected +++ b/cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected @@ -20,6 +20,7 @@ reverseRead argHasPostUpdate postWithInFlow | flowOut.cpp:84:3:84:14 | *access to array | PostUpdateNode should not be the target of local flow. | +| flowOut.cpp:111:28:111:31 | memcpy output argument | PostUpdateNode should not be the target of local flow. | | test.cpp:384:10:384:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. | | test.cpp:391:10:391:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. | | test.cpp:400:10:400:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. | diff --git a/cpp/ql/test/library-tests/dataflow/dataflow-tests/flowOut.cpp b/cpp/ql/test/library-tests/dataflow/dataflow-tests/flowOut.cpp index 820174cce39..f2ba9db6025 100644 --- a/cpp/ql/test/library-tests/dataflow/dataflow-tests/flowOut.cpp +++ b/cpp/ql/test/library-tests/dataflow/dataflow-tests/flowOut.cpp @@ -101,3 +101,18 @@ void test2() { addtaint2(&p); sink(*p); // $ ir MISSING: ast } + +using size_t = decltype(sizeof(int)); + +void* memcpy(void* dest, const void* src, size_t); + +void modify_copy_via_memcpy(char* p) { // $ ast-def=p + char* dest; + char* p2 = (char*)memcpy(dest, p, 10); + source_ref(p2); +} + +void test_modify_copy_via_memcpy(char* p) { // $ ast-def=p + modify_copy_via_memcpy(p); + sink(*p); // $ SPURIOUS: ir +} \ No newline at end of file diff --git a/cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected b/cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected index 3eb7d66fd0e..3601bc3d3cf 100644 --- a/cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected +++ b/cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected @@ -175,6 +175,7 @@ irFlow | flowOut.cpp:5:16:5:21 | call to source | flowOut.cpp:31:9:31:9 | x | | flowOut.cpp:5:16:5:21 | call to source | flowOut.cpp:61:8:61:11 | access to array | | flowOut.cpp:8:16:8:23 | call to source | flowOut.cpp:73:8:73:9 | * ... | +| flowOut.cpp:8:16:8:23 | call to source | flowOut.cpp:117:8:117:9 | * ... | | flowOut.cpp:84:18:84:23 | call to source | flowOut.cpp:85:8:85:9 | * ... | | flowOut.cpp:90:8:90:13 | call to source | flowOut.cpp:102:8:102:9 | * ... | | globals.cpp:5:17:5:22 | call to source | globals.cpp:6:10:6:14 | local | diff --git a/cpp/ql/test/library-tests/dataflow/dataflow-tests/uninitialized.expected b/cpp/ql/test/library-tests/dataflow/dataflow-tests/uninitialized.expected index a7539412adb..39fb882940d 100644 --- a/cpp/ql/test/library-tests/dataflow/dataflow-tests/uninitialized.expected +++ b/cpp/ql/test/library-tests/dataflow/dataflow-tests/uninitialized.expected @@ -2,6 +2,7 @@ | flowOut.cpp:44:7:44:7 | x | flowOut.cpp:46:8:46:8 | x | | flowOut.cpp:59:7:59:7 | x | flowOut.cpp:60:18:60:18 | x | | flowOut.cpp:59:7:59:7 | x | flowOut.cpp:61:8:61:8 | x | +| flowOut.cpp:110:9:110:12 | dest | flowOut.cpp:111:28:111:31 | dest | | ref.cpp:53:9:53:10 | x1 | ref.cpp:55:19:55:20 | x1 | | ref.cpp:53:9:53:10 | x1 | ref.cpp:56:10:56:11 | x1 | | ref.cpp:53:13:53:14 | x2 | ref.cpp:58:15:58:16 | x2 |