mirror of
https://github.com/python/cpython.git
synced 2025-11-10 10:32:04 +00:00
15 lines
307 B
Python
15 lines
307 B
Python
|
|
"""
|
||
|
|
PyDict_GetItem() returns a borrowed reference.
|
||
|
|
There are probably a number of places that are open to attacks
|
||
|
|
such as the following one, in bltinmodule.c:min_max().
|
||
|
|
"""
|
||
|
|
|
||
|
|
class KeyFunc(object):
|
||
|
|
def __call__(self, n):
|
||
|
|
del d['key']
|
||
|
|
return 1
|
||
|
|
|
||
|
|
|
||
|
|
d = {'key': KeyFunc()}
|
||
|
|
min(range(10), **d)
|