Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2caa8a

Browse files
committed
C++: Reverse taint through function models returning a reference.
1 parent f25ef26 commit f2caa8a

6 files changed

Lines changed: 110 additions & 13 deletions

File tree

cpp/ql/src/semmle/code/cpp/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,17 @@ private predicate exprToDefinitionByReferenceStep(Expr exprIn, Expr argOut) {
214214
exprIn = call.getQualifier()
215215
)
216216
)
217+
or
218+
exists(
219+
TaintFunction f, Call call, FunctionInput inModel, FunctionOutput outModel
220+
|
221+
call.getTarget() = f and
222+
inModel.isQualifierObject() and
223+
outModel.isReturnValueDeref() and
224+
f.hasTaintFlow(inModel, outModel) and
225+
exprIn = call and
226+
argOut = call.getQualifier()
227+
)
217228
}
218229

219230
private predicate exprToPartialDefinitionStep(Expr exprIn, Expr exprOut) {

0 commit comments

Comments
 (0)