-
Notifications
You must be signed in to change notification settings - Fork 371
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Dataflow is not detected correctly when a struct member assignment is performed on a struct pointer and the access is performed on the struct directly
To Reproduce
#include <stdio.h>
struct numbers {
int number_1;
int number_2;
};
int main(int argc, char **argv) {
struct numbers nums = {};
int one = 1;
nums.number_1 = one;
printf("%d", nums.number_1);
int two = 2;
struct numbers *nums_p = &nums;
nums_p->number_2 = two;
printf("%d", nums.number_2);
}
Import above code and run the queries
cpg.call("printf").reachableByFlows(cpg.identifier("one")).p //finds flow
cpg.call("printf").reachableByFlows(cpg.identifier("two")).p //empty
Only the flow to the first printf-call is detected
Expected behavior
Flows to both printf calls are detected
Desktop (please complete the following information):
- Joern Version 4.0.302
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working