Describe the bug
Dataflow is not generated correctly for assignments to arrays when the array index is a variable
To Reproduce
#include <stdio.h>
int main(int argc, char **argv) {
char *args[2];
int idx = 0;
args[idx] = argv[1];
args[1] = argv[1];
printf("Arg: %s", args[0]);
printf("Arg: %s", args[1]);
}
Import above code and run the query
cpg.call("printf").argument.reachableByFlows(cpg.method("main").parameter).p
Only the flow to the second printf-call is detected
Expected behavior
Flows to both printf calls are detected
Desktop (please complete the following information):