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

pySCG typo or error in CWE-703/CWE-392/compliant03.py #652

Open
myteron opened this issue Oct 11, 2024 · 1 comment
Open

pySCG typo or error in CWE-703/CWE-392/compliant03.py #652

myteron opened this issue Oct 11, 2024 · 1 comment

Comments

@myteron
Copy link
Contributor

myteron commented Oct 11, 2024

The CWE-703/CWE-392/compliant03.py

code has an error on line 22

        ret = list()
        invalid_arg = 0
        try:
            for res in result_gen:
                ret.append(res)
                invalid_arg += 1
            return ret

Not sure if its a typo, got flagged while using pyre.
Need to have a close look to understand the original intention of this code in order to fix it.

scovetta added a commit to scovetta/wg-best-practices-os-developers that referenced this issue Dec 23, 2024
The code snippet incorrectly returns `res` when it should be returning `ret`. This doesn't really have an effect, since the sample demonstrates failing early.

Signed-off-by: Michael Scovetta <[email protected]>
scovetta added a commit to scovetta/wg-best-practices-os-developers that referenced this issue Dec 23, 2024
The same code is in both the README and compliant03.py. This change fixes the typo in compliant03.py.

Signed-off-by: Michael Scovetta <[email protected]>
@scovetta
Copy link

Thanks @myteron! Fixed in #716.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants