Skip to content

Commit 97aa127

Browse files
committed
fixed a summary and prioritize summaries on interfaces over summaries on superclasses
1 parent 655c0b1 commit 97aa127

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/taintWrappers/resolvers/SummaryResolver.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,25 +170,24 @@ private boolean getSummariesHierarchy(final String methodSig, final ClassSummari
170170
*/
171171
private boolean checkInterfaces(String methodSig, ClassSummaries summaries, SootClass clazz,
172172
ByReferenceBoolean classSupported) {
173-
boolean hasSummaries = false;
174173
for (SootClass intf : clazz.getInterfaces()) {
175174
// Directly check the interface
176175
if (summaries.merge(flows.getMethodFlows(intf, methodSig)))
177-
hasSummaries = true;
176+
return true;
178177

179178
for (SootClass parent : getAllParentClasses(intf)) {
180179
// Do we have support for the interface?
181180
if (summaries.merge(flows.getMethodFlows(parent, methodSig)))
182-
hasSummaries = true;
181+
return true;
183182

184183
updateClassExclusive(classSupported, parent, methodSig);
185184
}
186185
}
187186

188187
// We inject the hierarchy from summaries before the data flow analysis, thus
189-
// the
190-
// soot hierarchy already contains the manual information provided in the xmls.
191-
return hasSummaries;
188+
// the soot hierarchy already contains the manual information provided in the
189+
// xmls.
190+
return false;
192191
}
193192

194193
});

soot-infoflow-summaries/summariesManual/java.util.Collection.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
<method id="boolean addAll(java.util.Collection)">
2323
<flows>
2424
<flow isAlias="false" typeChecking="false">
25-
<from sourceSinkType="Parameter" ParameterIndex="0" />
26-
<to sourceSinkType="Field"
25+
<from sourceSinkType="Parameter" ParameterIndex="0"
26+
AccessPath="[java.util.Collection: java.lang.Object[] innerArray]"
27+
AccessPathTypes="[java.lang.Object[]]" />
28+
<to sourceSinkType="Field"
2729
AccessPath="[java.util.Collection: java.lang.Object[] innerArray]"
2830
AccessPathTypes="[java.lang.Object[]]" />
2931
</flow>

0 commit comments

Comments
 (0)