Message123466
There is an issue in PyArg_ParseTuple() when using nested tuple arguments: it accepts a pure Python tuple-like argument, but it cannot work properly because PyArg_ParseTuple() is supposed to return borrowed references to the objects. For example, here is an attack on functools.partial().__setstate__(), which is written using
PyArg_ParseTuple(args, "(OOOO)", ...)
Running crasher.py crashes a debug build of Python, for me with Fatal Python error: _functoolsmodule.c:158 object at 0x9011748 has negative ref count -606348322.
The only way I can see to fix the crasher is to restrict the kind of argument that can be passed to mean a nested tuple. To be paranoid, it should only allow real tuples; a bit more flexibly, lists probably work ok too. |
|
Date |
User |
Action |
Args |
2010-12-06 13:43:19 | arigo | set | recipients:
+ arigo |
2010-12-06 13:43:19 | arigo | set | messageid: <1291642999.53.0.225447944395.issue10638@psf.upfronthosting.co.za> |
2010-12-06 13:43:16 | arigo | link | issue10638 messages |
2010-12-06 13:43:16 | arigo | create | |
|