mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C++: Fix 'strtok' model.
This commit is contained in:
@@ -32,6 +32,8 @@ private class Strtok extends ArrayFunction, AliasFunction, TaintFunction, SideEf
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
input.isParameter(0) and output.isReturnValue()
|
||||
or
|
||||
input.isParameterDeref(0) and output.isReturnValueDeref()
|
||||
}
|
||||
|
||||
override predicate hasOnlySpecificReadSideEffects() { none() }
|
||||
|
||||
@@ -718,6 +718,6 @@ void test_strtok_indirect() {
|
||||
char *source = indirect_source();
|
||||
const char* delim = ",.-;:_";
|
||||
char* tokenized = strtok(source, delim);
|
||||
sink(*tokenized); // $ MISSING: ast,ir
|
||||
sink(*tokenized); // $ ir MISSING: ast
|
||||
sink(*delim);
|
||||
}
|
||||
Reference in New Issue
Block a user