We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17485fe commit 4729daeCopy full SHA for 4729dae
docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/compliant01.py
@@ -3,15 +3,12 @@
3
""" Compliant Code Example """
4
5
6
-def sanitize_string(user_input):
7
- """Function that ensure a given string is safe"""
+def silly_string(user_input):
+ """Function that changes the content of a string"""
8
return user_input.replace("un", "very ")
9
10
11
-my_string = "unsafe string"
12
-my_string = sanitize_string(my_string)
13
-
14
#####################
15
# exploiting above code example
16
17
-print(my_string)
+print(silly_string("unsafe string"))
0 commit comments