Skip to content

Commit 5ddfe75

Browse files
committed
Python: Add value steps for sequence elements
It would be nice to simplify to a single sequence content type..
1 parent 59f9532 commit 5ddfe75

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

python/ql/lib/semmle/python/frameworks/Stdlib/StdLib.model.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,23 @@ extensions:
7676
# See https://docs.python.org/3/library/os.html#os.PathLike.__fspath__
7777
- ["pathlib.PurePath", "Member[__fspath__]", "Argument[self]", "ReturnValue", "taint"]
7878
# See
79+
# - https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.get
80+
# - https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.get_nowait
81+
- ["queue.Queue", "Member[get,get_nowait]", "Argument[self].ListElement", "ReturnValue", "value"]
82+
- ["queue.Queue", "Member[get,get_nowait]", "Argument[self]", "ReturnValue", "taint"]
83+
# See
7984
# - https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.put
8085
# - https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.put_nowait
86+
- ["queue.Queue", "Member[put,put_nowait]", "Argument[0,item:]", "Argument[self].ListElement", "value"]
8187
- ["queue.Queue", "Member[put,put_nowait]", "Argument[0,item:]", "Argument[self]", "taint"]
8288
# See
8389
# - https://docs.python.org/3/library/random.html#random.choice
8490
# - https://docs.python.org/3/library/random.html#module-random
91+
- ["random", "Member[choice]", "Argument[0,seq:].ListElement", "ReturnValue", "value"]
92+
- ["random", "Member[choice]", "Argument[0,seq:].SetElement", "ReturnValue", "value"]
8593
- ["random", "Member[choice]", "Argument[0,seq:]", "ReturnValue", "taint"]
94+
- ["random.Random", "Member[choice]", "Argument[0,seq:].ListElement", "ReturnValue", "value"]
95+
- ["random.Random", "Member[choice]", "Argument[0,seq:].SetElement", "ReturnValue", "value"]
8696
- ["random.Random", "Member[choice]", "Argument[0,seq:]", "ReturnValue", "taint"]
8797
# See https://docs.python.org/3/library/shlex.html#shlex.quote
8898
- ["shlex", "Member[quote]", "Argument[0,s:]", "ReturnValue", "taint"]

0 commit comments

Comments
 (0)