Skip to content

[Bug] Cant find path between arrayAccess and controlStructure.condition #5718

@qrkyckling

Description

@qrkyckling

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:

  1. c2cpg diary3.c
  2. joern cpg.bin
  3. cpg.arrayAccess.subscript.reachableByFlows( cpg.controlStructure ).p
  4. 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

Image Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions