C++: add flow through partial loads in DTT

This commit is contained in:
Robert Marsh
2020-01-29 17:51:42 -08:00
parent 1472101613
commit 71d87be773
5 changed files with 44 additions and 0 deletions

View File

@@ -77,4 +77,14 @@ void test_dynamic_cast() {
reinterpret_cast<D2*>(b2)->f(getenv("VAR"));
dynamic_cast<D3*>(b2)->f(getenv("VAR")); // tainted [FALSE POSITIVE]
}
void flow_to_outparam(char ** ret, char *arg) {
*ret = arg;
}
void test_outparams() {
char *p2 = nullptr;
flow_to_outparam(&p2, getenv("VAR"));
sink(p2); // tainted
}