Fix infinite loop on mixin self-includes #1611
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds ae37c48:
Hi! Thanks for the gem! While upgrading from 5.0.1 to 5.0.2 we had this regression when running brakeman in our CI. I narrowed it down to this unorthodox-but-technically-valid-ruby. We have a module in our codebase that includes itself when building a generic class. It caused brakeman to infinite loop on
Brakeman::Tracker#find_method
. I turned the smallest PoC I could into a test case.Another way to solve this might be to prevent a class being added to its own
includes
collection, but this was the easier fix. Thanks, again!