mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: Correct StrCpy.hasTaintFlow.
This commit is contained in:
@@ -93,9 +93,11 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
|
||||
}
|
||||
|
||||
override predicate hasDataFlow(FunctionInput input, FunctionOutput output) {
|
||||
not exists(getParamSize()) and
|
||||
input.isParameterDeref(getParamSrc()) and
|
||||
output.isParameterDeref(getParamDest())
|
||||
or
|
||||
not exists(getParamSize()) and
|
||||
input.isParameterDeref(getParamSrc()) and
|
||||
output.isReturnValueDeref()
|
||||
or
|
||||
@@ -106,7 +108,8 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
// these may do only a partial copy of the input buffer to the output
|
||||
// buffer
|
||||
input.isParameter(getParamSize()) and
|
||||
exists(getParamSize()) and
|
||||
input.isParameter(getParamSrc()) and
|
||||
(
|
||||
output.isParameterDeref(getParamDest()) or
|
||||
output.isReturnValueDeref()
|
||||
|
||||
Reference in New Issue
Block a user