Message302962
The following code causes the interpreter to crash:
class BadInt:
def __divmod__(*args):
return 42
import os
os.utime('foo.txt', ns=(BadInt(), 1))
This is because split_py_long_to_s_and_ns() (in Modules/posixmodule.c) assumes
that PyNumber_Divmod() returns a 2-tuple, and passes it to PyTuple_GET_ITEM(),
which assumes it is a tuple. Thus, PyTuple_GET_ITEM() might return a non-NULL
value which is not an address of a Python object. |
|
Date |
User |
Action |
Args |
2017-09-25 16:47:57 | Oren Milman | set | recipients:
+ Oren Milman |
2017-09-25 16:47:57 | Oren Milman | set | messageid: <1506358077.62.0.262986415269.issue31577@psf.upfronthosting.co.za> |
2017-09-25 16:47:57 | Oren Milman | link | issue31577 messages |
2017-09-25 16:47:57 | Oren Milman | create | |
|