mirror of
https://github.com/github/codeql.git
synced 2026-06-29 16:47:09 +02:00
16 lines
337 B
Python
16 lines
337 B
Python
import pathlib
|
|
|
|
|
|
def get_password():
|
|
return "password"
|
|
|
|
|
|
def write_password(filename):
|
|
password = get_password() # $ Source
|
|
|
|
path = pathlib.Path(filename)
|
|
path.write_text(password) # $ Alert # NOT OK
|
|
path.write_bytes(password.encode("utf-8")) # $ Alert # NOT OK
|
|
|
|
path.open("w").write(password) # $ Alert # NOT OK
|