mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
C++: Add test to show missing taint steps for std::vector::emplace/_back
This commit is contained in:
@@ -486,3 +486,13 @@ void test_vector_memcpy()
|
||||
sink(cs); // tainted [NOT DETECTED by IR]
|
||||
}
|
||||
}
|
||||
|
||||
void test_vector_emplace() {
|
||||
std::vector<int> v1(10), v2(10);
|
||||
|
||||
v1.emplace_back(source());
|
||||
sink(v1); // tainted
|
||||
|
||||
v2.emplace(v2.begin(), source());
|
||||
sink(v2); // tainted
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user