Skip to content

Commit 2c51f0f

Browse files
committed
Prevent NPE
1 parent b7e6610 commit 2c51f0f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,15 @@ protected Collection<ISourceSinkDefinition> getSinkDefinitions(Stmt sCallSite, I
294294

295295
final String subSig = callee.getSubSignature();
296296

297-
// Check whether we have any of the interfaces on the list
298-
for (SootClass i : parentClassesAndInterfaces
299-
.getUnchecked(sCallSite.getInvokeExpr().getMethod().getDeclaringClass())) {
300-
if (i.declaresMethod(subSig)) {
301-
Collection<ISourceSinkDefinition> def = this.sinkMethods.get(i.getMethod(subSig));
302-
if (def.size() > 0)
303-
return def;
297+
SootClass decl = sCallSite.getInvokeExpr().getMethod().getDeclaringClass();
298+
if (decl != null) {
299+
// Check whether we have any of the interfaces on the list
300+
for (SootClass i : parentClassesAndInterfaces.getUnchecked(decl)) {
301+
if (i.declaresMethod(subSig)) {
302+
Collection<ISourceSinkDefinition> def = this.sinkMethods.get(i.getMethod(subSig));
303+
if (def.size() > 0)
304+
return def;
305+
}
304306
}
305307
}
306308

0 commit comments

Comments
 (0)