mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Add tests.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| InsecureTemporaryFile.py:4:16:4:23 | ControlFlowNode for mktemp() | Call to deprecated function mktemp may be insecure. |
|
||||
@@ -0,0 +1,7 @@
|
||||
from tempfile import mktemp
|
||||
|
||||
def write_results(results):
|
||||
filename = mktemp()
|
||||
with open(filename, "w+") as f:
|
||||
f.write(results)
|
||||
print("Results written to", filename)
|
||||
@@ -0,0 +1 @@
|
||||
Security/CWE-377/InsecureTemporaryFile.ql
|
||||
@@ -0,0 +1,6 @@
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
def write_results(results):
|
||||
with NamedTemporaryFile(mode="w+", delete=False) as f:
|
||||
f.write(results)
|
||||
print("Results written to", f.name)
|
||||
Reference in New Issue
Block a user