Skip to content

Commit e87db10

Browse files
committed
More openness
1 parent 40790fb commit e87db10

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

soot-infoflow-summaries/summariesManual/javax.servlet.http.Cookie.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<summary fileFormatVersion="101">
33
<methods>
4+
<method id="void &lt;init&gt;(java.lang.String,java.lang.String)">
5+
<flows>
6+
<flow isAlias="false" typeChecking="false">
7+
<from sourceSinkType="Parameter" ParameterIndex="0" />
8+
<to sourceSinkType="Field" />
9+
</flow>
10+
<flow isAlias="false" typeChecking="false">
11+
<from sourceSinkType="Parameter" ParameterIndex="1" />
12+
<to sourceSinkType="Field" />
13+
</flow>
14+
</flows>
15+
</method>
416
<method id="java.lang.String getValue()">
517
<flows>
618
<flow isAlias="false" typeChecking="false">

soot-infoflow/src/soot/jimple/infoflow/data/SourceContextAndPath.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package soot.jimple.infoflow.data;
22

3-
import java.util.*;
3+
import java.util.ArrayList;
4+
import java.util.Collection;
5+
import java.util.Collections;
6+
import java.util.Iterator;
7+
import java.util.List;
8+
import java.util.Stack;
49

510
import heros.solver.Pair;
611
import soot.jimple.Stmt;
@@ -24,13 +29,13 @@ public class SourceContextAndPath extends SourceContext implements Cloneable {
2429

2530
private int hashCode = 0;
2631

27-
public SourceContextAndPath(InfoflowConfiguration config, Collection<ISourceSinkDefinition> definitions, AccessPath value,
28-
Stmt stmt) {
32+
public SourceContextAndPath(InfoflowConfiguration config, Collection<ISourceSinkDefinition> definitions,
33+
AccessPath value, Stmt stmt) {
2934
this(config, definitions, value, stmt, null);
3035
}
3136

32-
public SourceContextAndPath(InfoflowConfiguration config, Collection<ISourceSinkDefinition> definitions, AccessPath value,
33-
Stmt stmt, Object userData) {
37+
public SourceContextAndPath(InfoflowConfiguration config, Collection<ISourceSinkDefinition> definitions,
38+
AccessPath value, Stmt stmt, Object userData) {
3439
super(definitions, value, stmt, userData);
3540
this.config = config;
3641
}
@@ -49,6 +54,10 @@ public List<Stmt> getPath() {
4954
return stmtPath;
5055
}
5156

57+
public Abstraction getFirstAbstractionSlow() {
58+
return path.getFirstSlow();
59+
}
60+
5261
public List<Abstraction> getAbstractionPath() {
5362
if (path == null)
5463
return null;

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/ContextSensitivePathBuilder.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public Thread newThread(Runnable r) {
6464
return executor;
6565
}
6666

67-
private enum PathProcessingResult {
67+
protected enum PathProcessingResult {
6868
// Describes that the predecessor should be queued
6969
NEW,
7070
// Describes that the predecessor was already queued, but we might need to merge paths
@@ -111,7 +111,7 @@ private void processAndQueue(Abstraction pred, SourceContextAndPath scap) {
111111
case NEW:
112112
// Schedule the predecessor
113113
assert pathCache.containsKey(pred);
114-
scheduleDependentTask(new SourceFindingTask(pred));
114+
scheduleDependentTask(createSourceFindingTask(pred));
115115
break;
116116
case CACHED:
117117
// In case we already know the subpath, we do append the path after the path
@@ -128,7 +128,7 @@ private void processAndQueue(Abstraction pred, SourceContextAndPath scap) {
128128
}
129129
}
130130

131-
private PathProcessingResult processPredecessor(SourceContextAndPath scap, Abstraction pred) {
131+
protected PathProcessingResult processPredecessor(SourceContextAndPath scap, Abstraction pred) {
132132
// Shortcut: If this a call-to-return node, we should not enter and
133133
// immediately leave again for performance reasons.
134134
if (pred.getCurrentStmt() != null && pred.getCurrentStmt() == pred.getCorrespondingCallSite()) {
@@ -172,6 +172,7 @@ private PathProcessingResult processPredecessor(SourceContextAndPath scap, Abstr
172172
if (existingPaths != null && existingPaths.size() > maxPaths)
173173
return PathProcessingResult.INFEASIBLE_OR_MAX_PATHS_REACHED;
174174
}
175+
175176
return pathCache.put(pred, extendedScap) ? PathProcessingResult.NEW : PathProcessingResult.CACHED;
176177
}
177178

@@ -327,11 +328,15 @@ protected Runnable getTaintPathTask(final AbstractionAtSink abs) {
327328

328329
if (pathCache.put(abs.getAbstraction(), scap)) {
329330
if (!checkForSource(abs.getAbstraction(), scap))
330-
return new SourceFindingTask(abs.getAbstraction());
331+
return createSourceFindingTask(abs.getAbstraction());
331332
}
332333
return null;
333334
}
334335

336+
protected Runnable createSourceFindingTask(Abstraction abstraction) {
337+
return new SourceFindingTask(abstraction);
338+
}
339+
335340
@Override
336341
public InfoflowResults getResults() {
337342
return this.results;

0 commit comments

Comments
 (0)