C++: Fix strncpy model.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-06-18 13:13:28 +01:00
parent 273e5bc21f
commit fe97572f70
2 changed files with 2 additions and 2 deletions

View File

@@ -108,7 +108,7 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
// these may do only a partial copy of the input buffer to the output
// buffer
exists(this.getParamSize()) and
input.isParameter(this.getParamSrc()) and
input.isParameterDeref(this.getParamSrc()) and
(
output.isParameterDeref(this.getParamDest()) or
output.isReturnValueDeref()

View File

@@ -709,5 +709,5 @@ char * strncpy (char *, const char *, unsigned long);
void test_strncpy(char* d, char* s) {
argument_source(s);
strncpy(d, s, 16);
sink(d); // $ ast MISSING: ir
sink(d); // $ ast ir
}