Skip to content

Commit c8cbb50

Browse files
committed
Make sure we save the summary taint wrapper statement
1 parent e87db10 commit c8cbb50

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/taintWrappers/SummaryTaintWrapper.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,17 @@ public Set<Abstraction> getTaintsForMethod(Stmt stmt, Abstraction d1, Abstractio
539539
callee = m;
540540
}
541541
res = computeTaintsForMethod(stmt, d1, taintedAbs, callee, killIncomingTaint, classSupported);
542+
boolean wasEqualToIncoming = false;
542543

543544
// Create abstractions from the access paths
544545
if (res != null && !res.isEmpty()) {
545546
if (resAbs == null)
546547
resAbs = new HashSet<>();
547-
for (AccessPath ap : res)
548+
for (AccessPath ap : res) {
548549
resAbs.add(taintedAbs.deriveNewAbstraction(ap, stmt));
550+
if (ap.equals(taintedAbs.getAccessPath()))
551+
wasEqualToIncoming = true;
552+
}
549553
}
550554

551555
// If we have no data flows, we can abort early
@@ -568,7 +572,8 @@ public Set<Abstraction> getTaintsForMethod(Stmt stmt, Abstraction d1, Abstractio
568572
if (!killIncomingTaint.value) {
569573
if (resAbs == null)
570574
return Collections.singleton(taintedAbs);
571-
resAbs.add(taintedAbs);
575+
if (!wasEqualToIncoming)
576+
resAbs.add(taintedAbs);
572577
}
573578
return resAbs;
574579
}

0 commit comments

Comments
 (0)