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

Skip to content

Commit 32f494e

Browse files
committed
Use SummaryModelCsv in MyBatisAbstractSQLMethodsStep
1 parent d47fced commit 32f494e

1 file changed

Lines changed: 8 additions & 20 deletions

File tree

java/ql/lib/semmle/code/java/frameworks/MyBatis.qll

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private class MyBatisProviderStep extends TaintTracking::AdditionalTaintStep {
146146
providerMethod.getParameter(i) = n2.asParameter()
147147
)
148148
|
149-
a.getType() instanceof MyBatisProvider and
149+
a.getType() instanceof MyBatisProvider and
150150
ma.getMethod().getAnAnnotation() = a and
151151
providerMethod.getDeclaringType() =
152152
a.getValue(["type", "value"]).(TypeLiteral).getTypeName().getType() and
@@ -155,25 +155,13 @@ private class MyBatisProviderStep extends TaintTracking::AdditionalTaintStep {
155155
}
156156
}
157157

158-
private class MyBatisAbstractSQLToStringStep extends TaintTracking::AdditionalTaintStep {
159-
override predicate step(DataFlow::Node node1, DataFlow::Node node2) {
160-
exists(MethodAccess ma |
161-
ma.getMethod().getDeclaringType().getSourceDeclaration() instanceof MyBatisAbstractSQL and
162-
ma.getMethod().getName() = "toString" and
163-
ma.getQualifier() = node1.asExpr() and
164-
ma = node2.asExpr()
165-
)
166-
}
167-
}
168-
169-
private class MyBatisAbstractSQLMethodsStep extends TaintTracking::AdditionalTaintStep {
170-
override predicate step(DataFlow::Node node1, DataFlow::Node node2) {
171-
exists(MethodAccess ma |
172-
ma.getMethod().getDeclaringType().getSourceDeclaration() instanceof MyBatisAbstractSQL and
173-
ma.getMethod().getName() instanceof MyBatisAbstractSQLMethodNames and
174-
ma.getArgument([0, 1]) = node1.asExpr() and
175-
ma = node2.asExpr()
176-
)
158+
private class MyBatisAbstractSQLMethodsStep extends SummaryModelCsv {
159+
override predicate row(string row) {
160+
row =
161+
[
162+
"org.apache.ibatis.jdbc;AbstractSQL;true;" + any(MyBatisAbstractSQLMethodNames m) +
163+
";;;Argument[0..1];ReturnValue;taint"
164+
]
177165
}
178166
}
179167

0 commit comments

Comments
 (0)