Skip to content

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

Open

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

Activity

  1. qrkyckling commented on Dec 5, 2025

    @qrkyckling
    Author

    The arrayaccess is the only one in the binary
    Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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