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 43225ce commit 17485feCopy full SHA for 17485fe
docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/noncompliant01.py
@@ -3,15 +3,13 @@
3
""" Non-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
user_input.replace("un", "very ")
9
+ return user_input
10
11
-my_string = "unsafe string"
12
-sanitize_string(my_string)
13
-
14
#####################
15
# exploiting above code example
16
17
-print(my_string)
+print(silly_string("unsafe string"))
0 commit comments