secure-software-engineering / FlowDroid

FlowDroid Static Data Flow Tracker
GNU Lesser General Public License v2.1
1.02k stars 293 forks source link

NP Exception in RecursivePathBuilder #567

Open notify-bibi opened 1 year ago

notify-bibi commented 1 year ago
        soot/jimple/infoflow/data/SourceContextAndPath.java:153
        public SourceContextAndPath extendPath(Abstraction abs) {
        return extendPath(abs, null);
    }

        soot/jimple/infoflow/data/SourceContextAndPath.java:165
    public SourceContextAndPath extendPath(Abstraction abs, InfoflowConfiguration config) {
               ...

          switch (config.getDataFlowDirection()) { // 'java.lang.NullPointerException'
              }
               ....
       }
       soot.jimple.infoflow.results.InfoflowResults: line 159
       public Pair<ResultSourceInfo, ResultSinkInfo> addResult(ISourceSinkDefinition sinkDefinition, AccessPath sink,
            Stmt sinkStmt, ISourceSinkDefinition sourceDefinition, AccessPath source, Stmt sourceStmt, Object userData,
            List<Abstraction> propagationPath) {
        return addResult(sinkDefinition, sink, sinkStmt, sourceDefinition, source, sourceStmt, userData,
                propagationPath, null); // NULL Manager
    }

    public Pair<ResultSourceInfo, ResultSinkInfo> addResult(ISourceSinkDefinition sinkDefinition, AccessPath sink,
            Stmt sinkStmt, ISourceSinkDefinition sourceDefinition, AccessPath source, Stmt sourceStmt, Object userData,
            List<Abstraction> propagationPath, InfoflowManager manager) {
        if (propagationPath != null) {
            stmtPath = new ArrayList<>(propagationPath.size());
            apPath = new ArrayList<>(propagationPath.size());
            if (!manager.getConfig().getPathAgnosticResults()) // 'java.lang.NullPointerException'
                csPath = new ArrayList<>(propagationPath.size());
            for (Abstraction pathAbs : propagationPath) {
                if (pathAbs.getCurrentStmt() != null) {
                    stmtPath.add(pathAbs.getCurrentStmt());
                    apPath.add(pathAbs.getAccessPath());
                    if (csPath != null)
                        csPath.add(pathAbs.getCorrespondingCallSite());
                }
            }
        }
                ....
    }
timll commented 1 year ago

Hi,

I already fixed the NPE some time ago. You should be fine by using the most recent commit on develop or the release on maven.