Files
codeql/python/ql/test/2/query-tests/Expressions/expressions_test.py
2026-06-15 16:15:17 +01:00

19 lines
447 B
Python

def use_of_apply(func, args):
apply(func, args) # $ Alert[py/use-of-apply]
def use_of_input():
return input() # $ Alert[py/use-of-input] # NOT OK
def not_use_of_input():
input = raw_input
return input() # OK
if __name__ == "__main__":
# if you enter 4+4 each time, you'll see that results are: 8, '4+4', 8
print("result:", use_of_input())
print("result:", not_use_of_input())
print("result:", use_of_input())