Skip to content

Commit 1a12b83

Browse files
authored
Merge pull request #616 from timll/develop
Small fixes
2 parents 3c62756 + a648b05 commit 1a12b83

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

soot-infoflow-summaries/summariesManual/org.json.JSONObject.xml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,22 +730,38 @@
730730
<method id="java.lang.String toString()">
731731
<flows>
732732
<flow isAlias="false" typeChecking="false">
733-
<from sourceSinkType="Field" />
733+
<from sourceSinkType="Field"
734+
AccessPath="[org.json.JSONObject: java.lang.Object[] values]"
735+
AccessPathTypes="[java.lang.Object[]]"/>
736+
<to sourceSinkType="Return" />
737+
</flow>
738+
<flow isAlias="false" typeChecking="false">
739+
<from sourceSinkType="Field"
740+
AccessPath="[org.json.JSONArray: java.lang.String[] keys]"
741+
AccessPathTypes="[java.lang.Object[]]"/>
734742
<to sourceSinkType="Return" />
735743
</flow>
736744
</flows>
737745
</method>
738746
<method id="java.lang.String toString(int)">
739747
<flows>
740748
<flow isAlias="false" typeChecking="false">
741-
<from sourceSinkType="Field" />
749+
<from sourceSinkType="Field"
750+
AccessPath="[org.json.JSONObject: java.lang.Object[] values]"
751+
AccessPathTypes="[java.lang.Object[]]"/>
752+
<to sourceSinkType="Return" />
753+
</flow>
754+
<flow isAlias="false" typeChecking="false">
755+
<from sourceSinkType="Field"
756+
AccessPath="[org.json.JSONArray: java.lang.String[] keys]"
757+
AccessPathTypes="[java.lang.Object[]]"/>
742758
<to sourceSinkType="Return" />
743759
</flow>
744760
</flows>
745761
</method>
746762
<method id="java.lang.String valueToString(java.lang.Object)">
747763
<flows>
748-
<flow isAlias="false" typeChecking="false">
764+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
749765
<from sourceSinkType="Parameter" ParameterIndex="0" />
750766
<to sourceSinkType="Return" />
751767
</flow>

soot-infoflow/src/soot/jimple/infoflow/results/xml/InfoflowResultsSerializer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import soot.jimple.infoflow.InfoflowConfiguration;
1313
import soot.jimple.infoflow.data.AccessPath;
1414
import soot.jimple.infoflow.data.AccessPathFragment;
15+
import soot.jimple.infoflow.data.SootMethodAndClass;
1516
import soot.jimple.infoflow.results.InfoflowPerformanceData;
1617
import soot.jimple.infoflow.results.InfoflowResults;
1718
import soot.jimple.infoflow.results.ResultSinkInfo;
@@ -209,7 +210,8 @@ private void writeSourceInfo(ResultSourceInfo source, XMLStreamWriter writer) th
209210
ISourceSinkDefinition def = source.getDefinition();
210211
if (def instanceof MethodSourceSinkDefinition) {
211212
MethodSourceSinkDefinition ms = (MethodSourceSinkDefinition) def;
212-
writer.writeAttribute(XmlConstants.Attributes.methodSourceSinkDefinition, ms.getMethod().getSignature());
213+
if (ms.getMethod() != null)
214+
writer.writeAttribute(XmlConstants.Attributes.methodSourceSinkDefinition, ms.getMethod().getSignature());
213215
}
214216

215217
writeAdditionalSourceInfo(source, writer);
@@ -271,7 +273,8 @@ private void writeSinkInfo(ResultSinkInfo sink, XMLStreamWriter writer) throws X
271273
ISourceSinkDefinition def = sink.getDefinition();
272274
if (def instanceof MethodSourceSinkDefinition) {
273275
MethodSourceSinkDefinition ms = (MethodSourceSinkDefinition) def;
274-
writer.writeAttribute(XmlConstants.Attributes.methodSourceSinkDefinition, ms.getMethod().getSignature());
276+
if (ms.getMethod() != null)
277+
writer.writeAttribute(XmlConstants.Attributes.methodSourceSinkDefinition, ms.getMethod().getSignature());
275278
}
276279
writeAdditionalSinkInfo(sink, writer);
277280
writeAccessPath(sink.getAccessPath(), writer);

soot-infoflow/src/soot/jimple/infoflow/sourcesSinks/manager/BaseSourceSinkManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ protected Collection<ISourceSinkDefinition> getInverseSourceDefinition(Stmt sCal
333333

334334
// Only difference to getSource
335335
if (!SystemClassHandler.v().isTaintVisible(ap, callee))
336-
return null;
336+
return Collections.emptySet();
337337

338338
Collection<ISourceSinkDefinition> defs = getSourceDefinition(callee);
339339
if (defs.size() > 0)

0 commit comments

Comments
 (0)