Describe the bug
Trying to learn joern rules by working on an old ctf from HTB, namely dream diary 3.
Decompiled in Ghidra and exported to C.
Wrote a rule to find path from a local variable inside a do-while loop to the conditionOut of the loop.
No path is found.
To Reproduce
Steps to reproduce the behavior:
- c2cpg diary3.c
- joern cpg.bin
- cpg.arrayAccess.subscript.reachableByFlows( cpg.controlStructure ).p
- or cpg.arrayAccess.subscript.reachableByFlows( cpg.controlStructure.condition ).p
No flows found
Expected behavior
Since the variable is used inside the do-while loop I would expect a path to be found
Screenshots
Desktop (please complete the following information):
- OS Linux Ubuntu 24.04.3
- Joern Version 4.0.451
- Java version 21.0.9
Additional context
Add any other context about the problem here.
diary3.zip