Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ossdataflowengine: fix edge case when tracking from receivers #2722

Merged
merged 2 commits into from
May 16, 2023

Conversation

fabsx00
Copy link
Contributor

@fabsx00 fabsx00 commented May 16, 2023

This problem became apparent after #2680 was merged: when using a receiver as a source, and we manage to track back all the way to an invocation on that receiver, we do not consider the call on that receiver to be a source as well. In fact, it's somewhat debatable whether we should. The reason I believe we should is that if we are unable to resolve the method, we will actually jump back to the receiver, while if we can resolve it, we don't. In order to be consistent regardless of whether the method can be resolved or not, this change is necessary.

Copy link
Collaborator

@DavidBakerEffendi DavidBakerEffendi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more Scala-centric style suggestion

…eryengine/SourcesToStartingPoints.scala

Co-authored-by: David Baker Effendi <dbe@sun.ac.za>
@fabsx00 fabsx00 merged commit 97a7fac into master May 16, 2023
5 checks passed
fabsx00 pushed a commit that referenced this pull request May 17, 2023
fabsx00 added a commit that referenced this pull request May 17, 2023
#2731)

* Revert "Make pysrc2cpg compatible with closed source data flow tracker again. (#2680)"

This reverts commit 744fc30.

* Revert "ossdataflowengine: fix edge case when tracking from receivers (#2722)"

This reverts commit 97a7fac.

---------

Co-authored-by: Fabian Yamaguchi <fabs@joern.io>
DavidBakerEffendi added a commit that referenced this pull request Jun 2, 2023
* Make pysrc2cpg compatible with closed source data flow tracker again. (#2680)

* ossdataflowengine: fix edge case when tracking from receivers (#2722)

* Type Recovery Tweaks
* Added tests that were resulting in some failure
* Added support for string constant type hints (idk how but this is valid Python)
* Using `ForkJoinParallelCpgPass` for `DynamicTypeHintFullNamePass`
* Making sure that `DynamicTypeHintFullNamePass` considers types within the current scope
* Sharing the logic for import path resolution between `XInheritanceFullNamePass` and `DynamicTypeHintFullNamePass`
DavidBakerEffendi added a commit that referenced this pull request Jun 7, 2023
Extended the fix #2722 by testing when the source is an identifier and accommodating this case
DavidBakerEffendi added a commit that referenced this pull request Jun 7, 2023
Extended the fix #2722 by testing when the source is an identifier and accommodating this case
@max-leuthaeuser max-leuthaeuser deleted the fabs/edgecasedflow branch July 18, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants