SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.51k stars 1.11k forks source link

Fix an inappropriate test expression to remove a logical short circuit #1559

Closed munahaf closed 9 months ago

munahaf commented 9 months ago

In file: processor.py, the comparison of Collection length creates a logical short circuit. The length of a collection is always greater than or equal to zero. So testing that a length is less than zero is always false.

I suggested that the Collection length comparison should be done without creating a logical short circuit.

Sponsorship and Support:

This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. 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.

heinezen commented 9 months ago

Thanks for the fix. Can you do the following before we merge this?

TheJJ commented 9 months ago

the commit for your authorship isn't pushed to this pull request's branch yet.

heinezen commented 9 months ago

Do you need help with any of this?

heinezen commented 9 months ago

I've cherry picked your commit and added it to the correct branch. It should be mergeable now.