C++: Restore some of the lost test results by doing operand -> instruction taint steps in IR TaintTracking.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-03-02 15:45:40 +01:00
parent 23d3109071
commit eb4f1e1ba0
5 changed files with 62 additions and 64 deletions

View File

@@ -13,8 +13,8 @@ int main() {
sink(_strdup(getenv("VAR"))); // $ MISSING: ast,ir
sink(strdup(getenv("VAR"))); // $ ast MISSING: ir
sink(_strdup(getenv("VAR"))); // $ ir MISSING: ast
sink(strdup(getenv("VAR"))); // $ ast,ir
sink(unmodeled_function(getenv("VAR"))); // clean by assumption
char untainted_buf[100] = "";

View File

@@ -369,9 +369,9 @@ void test_strdup(char *source)
a = strdup(source);
b = strdup("hello, world");
c = strndup(source, 100);
sink(a); // $ ast MISSING: ir
sink(a); // $ ast,ir
sink(b);
sink(c); // $ ast MISSING: ir
sink(c); // $ ast,ir
}
void test_strndup(int source)
@@ -388,7 +388,7 @@ void test_wcsdup(wchar_t *source)
a = wcsdup(source);
b = wcsdup(L"hello, world");
sink(a); // $ ast MISSING: ir
sink(a); // $ ast,ir
sink(b);
}