-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix inappropriate comparison on the length of a Collection #7125
Fix inappropriate comparison on the length of a Collection #7125
Conversation
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.
Thanks for your contribution! Can you please add a changelog fragment? Thanks.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
593f30d
to
f43d477
Compare
…. Added changlelog fragment file.
f43d477
to
0573bc5
Compare
Co-authored-by: Felix Fontein <[email protected]>
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #7146 🤖 @patchback |
* Comment: Fixed inappropriate comparison on the length of a Collection. Added changlelog fragment file. * Comment: Updated the scope of the changelog fragment based on feedback. Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 7721420)
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #7147 🤖 @patchback |
* Comment: Fixed inappropriate comparison on the length of a Collection. Added changlelog fragment file. * Comment: Updated the scope of the changelog fragment based on feedback. Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 7721420)
@munahaf thanks a lot for your contribution! |
…n the length of a Collection (#7146) Fix inappropriate comparison on the length of a Collection (#7125) * Comment: Fixed inappropriate comparison on the length of a Collection. Added changlelog fragment file. * Comment: Updated the scope of the changelog fragment based on feedback. Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 7721420) Co-authored-by: Munawar <[email protected]>
…n the length of a Collection (#7147) Fix inappropriate comparison on the length of a Collection (#7125) * Comment: Fixed inappropriate comparison on the length of a Collection. Added changlelog fragment file. * Comment: Updated the scope of the changelog fragment based on feedback. Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 7721420) Co-authored-by: Munawar <[email protected]>
…ollections#7125) * Comment: Fixed inappropriate comparison on the length of a Collection. Added changlelog fragment file. * Comment: Updated the scope of the changelog fragment based on feedback. Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]>
In file: oci_utils.py, there are several places in the code where the comparison of Collection length creates a logical short circuit. The way the Collection length is checked (e.g.,
len(t) >= 0
) always returns true. I suggested that the Collection length comparison should be done without creating a logical short circuit. This should be reviewed to verify that the spirit of the original code has been kept by the change.Sponsorship and Support:
This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF)(https://openssf.org/): Project Alpha-Omega(https://alpha-omega.dev/). Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed – to improve global software supply chain security.
The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.