Skip to content

Commit 4729dae

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

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
""" 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
return user_input.replace("un", "very ")
99

1010

11-
my_string = "unsafe string"
12-
my_string = sanitize_string(my_string)
13-
1411
#####################
1512
# exploiting above code example
1613
#####################
17-
print(my_string)
14+
print(silly_string("unsafe string"))

0 commit comments

Comments
 (0)