mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
C++: Fix strncpy model.
This commit is contained in:
@@ -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
|
// these may do only a partial copy of the input buffer to the output
|
||||||
// buffer
|
// buffer
|
||||||
exists(this.getParamSize()) and
|
exists(this.getParamSize()) and
|
||||||
input.isParameter(this.getParamSrc()) and
|
input.isParameterDeref(this.getParamSrc()) and
|
||||||
(
|
(
|
||||||
output.isParameterDeref(this.getParamDest()) or
|
output.isParameterDeref(this.getParamDest()) or
|
||||||
output.isReturnValueDeref()
|
output.isReturnValueDeref()
|
||||||
|
|||||||
@@ -709,5 +709,5 @@ char * strncpy (char *, const char *, unsigned long);
|
|||||||
void test_strncpy(char* d, char* s) {
|
void test_strncpy(char* d, char* s) {
|
||||||
argument_source(s);
|
argument_source(s);
|
||||||
strncpy(d, s, 16);
|
strncpy(d, s, 16);
|
||||||
sink(d); // $ ast MISSING: ir
|
sink(d); // $ ast ir
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user