Message327653
Constructing bytes from mutating list can cause a crash.
class X:
def __index__(self):
if len(a) < 1000:
a.append(self)
return 0
a = [X()]
bytes(a)
This is not an issue about weird integer-like objects. It is about . The size of the list can be changed in other thread while iterate it in the bytes constructor.
The optimization for the case of the list argument was added in issue6688. The code was refactored several times since, but this flaw was always. |
|
Date |
User |
Action |
Args |
2018-10-13 13:37:47 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, alexandre.vassalotti |
2018-10-13 13:37:47 | serhiy.storchaka | set | messageid: <1539437867.82.0.788709270274.issue34973@psf.upfronthosting.co.za> |
2018-10-13 13:37:47 | serhiy.storchaka | link | issue34973 messages |
2018-10-13 13:37:47 | serhiy.storchaka | create | |
|