Skip to content

Commit 17485fe

Browse files
myterons19110
andauthored
Update docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/noncompliant01.py
Co-authored-by: Hubert Daniszewski <[email protected]> Signed-off-by: myteron <[email protected]>
1 parent 43225ce commit 17485fe

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/noncompliant01.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
""" Non-compliant Code Example """
44

55

6-
def sanitize_string(user_input):
7-
"""Function that ensure a given string is safe"""
6+
def silly_string(user_input):
7+
"""Function that changes the content of a string"""
88
user_input.replace("un", "very ")
9+
return user_input
910

1011

11-
my_string = "unsafe string"
12-
sanitize_string(my_string)
13-
1412
#####################
1513
# exploiting above code example
1614
#####################
17-
print(my_string)
15+
print(silly_string("unsafe string"))

0 commit comments

Comments
 (0)