-
Notifications
You must be signed in to change notification settings - Fork 240
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
Remove extraneous reassignments in output #166
Remove extraneous reassignments in output #166
Conversation
The output should consist of the path from the source to the sink. Anything which happens after the source reaches the sink is irrelevant and just makes the output longer and confusing to interpret. None of the lines removed from the tests actually affected the vulnerability chain. Perhaps this should be dealt with somewhere in the definition_chain or vulnerability functions: here we just trim the chain upon reaching the sink in the vulnerability_helper.
@@ -56,16 +57,13 @@ def __init__( | |||
self.sink = sink | |||
self.sink_trigger_word = sink_trigger_word | |||
|
|||
self.reassignment_nodes = reassignment_nodes | |||
self._remove_sink_from_secondary_nodes() | |||
# Remove the sink node and all nodes after the sink from the list of reassignments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
This is amazing, it used to be more confusing but I forgot about after the sink. Thanks so much for making this.
self.reassignment_nodes = reassignment_nodes | ||
self._remove_sink_from_secondary_nodes() | ||
# Remove the sink node and all nodes after the sink from the list of reassignments. | ||
self.reassignment_nodes = list(takewhile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL takewhile
I'm confused, shouldn't reassignment nodes always be the vulnerability chain (i.e. path from the source to the sink)? https://github.com/python-security/pyt/blob/master/pyt/vulnerabilities/vulnerabilities.py#L460 always gets hit, because I made I totally agree with you about the output. |
You're absolutely right. I'm stupid. The tests default to |
You're definitely not stupid 🙂 |
OK 😄 |
The output should consist of the path from the source to the sink.
Anything which happens after the source reaches the sink is irrelevant
and just makes the output longer and confusing to interpret.
None of the lines removed from the tests actually affected the
vulnerability chain.
Perhaps this should be dealt with somewhere in the definition_chain or
vulnerability functions: here we just trim the chain upon reaching the
sink in the vulnerability_helper.