Skip to content

Commit edd4468

Browse files
committed
Fix tests by stubbing relevant os functions.
1 parent 6f7c96d commit edd4468

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
| InsecureTemporaryFile.py:5:16:5:23 | ControlFlowNode for mktemp() | Call to deprecated function $@.$@ may be insecure. | tempfile | mktemp |
2+
| InsecureTemporaryFile.py:11:16:11:27 | ControlFlowNode for Attribute() | Call to deprecated function $@.$@ may be insecure. | os | tempnam |
3+
| InsecureTemporaryFile.py:17:16:17:26 | ControlFlowNode for Attribute() | Call to deprecated function $@.$@ may be insecure. | os | tmpnam |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
semmle-extractor-options: -p ../lib/ --max-import-depth=3
2+
optimize: true

python/ql/test/query-tests/Security/lib/os/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ def chmod(path, mode):
99

1010
def open(path, flags, mode):
1111
pass
12+
13+
def tempnam(*args):
14+
pass
15+
16+
def tmpnam(*args):
17+
pass

0 commit comments

Comments
 (0)