Skip to content

Commit fe97572

Browse files
committed
C++: Fix strncpy model.
1 parent 273e5bc commit fe97572

File tree

2 files changed

+2
-2
lines changed
  • cpp/ql
    • lib/semmle/code/cpp/models/implementations
    • test/library-tests/dataflow/taint-tests

2 files changed

+2
-2
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/Strcpy.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
108108
// these may do only a partial copy of the input buffer to the output
109109
// buffer
110110
exists(this.getParamSize()) and
111-
input.isParameter(this.getParamSrc()) and
111+
input.isParameterDeref(this.getParamSrc()) and
112112
(
113113
output.isParameterDeref(this.getParamDest()) or
114114
output.isReturnValueDeref()

cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,5 +709,5 @@ char * strncpy (char *, const char *, unsigned long);
709709
void test_strncpy(char* d, char* s) {
710710
argument_source(s);
711711
strncpy(d, s, 16);
712-
sink(d); // $ ast MISSING: ir
712+
sink(d); // $ ast ir
713713
}

0 commit comments

Comments
 (0)