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: Adding documentation to CWE-175 as part of #531 #687

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

s19110
Copy link
Contributor

@s19110 s19110 commented Oct 31, 2024

Adding documentation to CWE-175 as part of #531

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code not working, line 12 and 15 are missing locale.CURRENT_LOCALE

@myteron myteron changed the title Adding documentation to CWE-175 as part of #531 pySCG: Adding documentation to CWE-175 as part of #531 Nov 6, 2024
# Trying to exploit above code example
#####################

locale.setlocale(locale.LC_ALL, CURRENT_LOCALE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to initialise CURRENT_LOCALE in here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is resolved!

print(f"Locale is {locale.getlocale()}")
print(f"Do the numbers match? {compare_number(ORIGINAL_NUMBER)}")

## Locale is ('English_Ireland', '1252')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter also gives out everytime there is more than one "#" for me
too many leading '#' for block commentFlake8(E266)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is resolved!

""" Non-compliant Code Example """
import io

LOREM = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a lot of "Line too long" from Pylint... not sure if we care about this though:
Line too long (456/100)PylintC0301:line-too-long
(constant) LOREM: Literal['Lorem ipsum dolor sit amet, consectetur adipiscing…']

Got that for lines 6,7,8 and 18

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can resolve this, don't think we care about this

""" Compliant Code Example """
import io

LOREM = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylint giving out that lines 6, 7 and 8 are too long... not sure if we care though...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we care here either, can be resolved

Copy link
Contributor

@BartyBoi1128 BartyBoi1128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comments with suggestions, In "example03.py" I couldn't leave a suggested change on all the lines but essentially just wondering can we remove one "#" from the comments, just leave it at "#" rather than "##"

s19110 and others added 6 commits November 21, 2024 12:52
…1.py

Co-authored-by: BartyBoi1128 <[email protected]>
Signed-off-by: Hubert Daniszewski <[email protected]>
…2.py

Co-authored-by: BartyBoi1128 <[email protected]>
Signed-off-by: Hubert Daniszewski <[email protected]>
…nt01.py

Co-authored-by: BartyBoi1128 <[email protected]>
Signed-off-by: Hubert Daniszewski <[email protected]>
s19110 and others added 3 commits November 21, 2024 12:56
…nt01.py

Co-authored-by: BartyBoi1128 <[email protected]>
Signed-off-by: Hubert Daniszewski <[email protected]>
…nt02.py

Co-authored-by: BartyBoi1128 <[email protected]>
Signed-off-by: Hubert Daniszewski <[email protected]>
…nt01.py

Co-authored-by: BartyBoi1128 <[email protected]>
Signed-off-by: Hubert Daniszewski <[email protected]>
@s19110
Copy link
Contributor Author

s19110 commented Nov 21, 2024

Left comments with suggestions, In "example03.py" I couldn't leave a suggested change on all the lines but essentially just wondering can we remove one "#" from the comments, just leave it at "#" rather than "##"

Thank you for the suggestions, I have now merged all of them. As for the "##" in comments, I will change them to a singular "#" and indicate if they are supposed to be console output or something else.

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

Successfully merging this pull request may close these issues.

3 participants