secure-software-engineering / FlowDroid

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

ArrayIndexOutOfBoundsException in propagateConstantsIntoCallee #292

Open borzacchiello opened 3 years ago

borzacchiello commented 3 years ago

Hello, I was using FlowDroid to analyze an APK, and it crashed during the constant value propagation phase.

As far as I understood it, the ICFG has an edge between a callsite with a call to boolean sendMessageDelayed(android.os.Message,long) and the function void handleMessage(android.os.Message). While it seems reasonable, the two functions have different parameters, and this line https://github.com/secure-software-engineering/FlowDroid/blob/develop/soot-infoflow/src/soot/jimple/infoflow/codeOptimization/InterproceduralConstantValuePropagator.java#L826 crashes since isConstant array has only one element.

How can this issue be fixed? Something like:

if (iiExpr.getArgCount() != sm.getParameterCount()) {
        hasCallSites = false;
        break;
}

just after https://github.com/secure-software-engineering/FlowDroid/blob/develop/soot-infoflow/src/soot/jimple/infoflow/codeOptimization/InterproceduralConstantValuePropagator.java#L814 seems reasonable? Or maybe if the callSite is different from the function, then the constant propagation for that method must be killed?

Let me know if I am understanding the problem correctly!

Thanks, Luca

YaphetsH commented 3 years ago

Hi~ I have same problem with you.Did you solve it?

tianqi1128 commented 3 years ago

Hi, I also encountered the problem. Do you know how to fix it?