mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C++: add flow through partial loads in DTT
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user