mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
C++: Wire up models to DefaultTaintTracking
This adds support for arg-to-arg and arg-to-return taint.
This commit is contained in:
@@ -13,13 +13,13 @@ int main(int argc, char *argv[]) {
|
||||
int taintedInt = atoi(getenv("VAR"));
|
||||
taintedInt++; // BUG: `taintedInt` isn't marked as tainted. Only `++` is.
|
||||
|
||||
sink(_strdup(getenv("VAR"))); // BUG: no taint
|
||||
sink(_strdup(getenv("VAR")));
|
||||
sink(strdup(getenv("VAR")));
|
||||
sink(unmodeled_function(getenv("VAR")));
|
||||
|
||||
char untainted_buf[100] = "";
|
||||
char buf[100] = "VAR = ";
|
||||
sink(strcat(buf, getenv("VAR"))); // BUG: no taint
|
||||
sink(strcat(buf, getenv("VAR")));
|
||||
|
||||
sink(buf); // BUG: no taint
|
||||
sink(untainted_buf); // the two buffers would be conflated if we added flow through partial chi inputs
|
||||
|
||||
Reference in New Issue
Block a user