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

[PR #7125/77214203 backport][stable-6] Fix inappropriate comparison on the length of a Collection #7146

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Aug 22, 2023

This is a backport of PR #7125 as merged into main (7721420).

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.

* 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)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport cloud module_utils module_utils new_contributor Help guide this first time contributor plugins plugin (any type) labels Aug 22, 2023
@felixfontein felixfontein merged commit 97e17fc into stable-6 Aug 23, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-6/7721420388aa1d9cf7751fa250754d3419f3a2b1/pr-7125 branch August 23, 2023 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud module_utils module_utils new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants