Message241454
The yield-from implementation calls _PyGen_FetchStopIterationValue() to get the exception value. If the StopIteration exception is not normalised, e.g. because it was set by PyErr_SetObject() in a C extension, then _PyGen_FetchStopIterationValue() will cast to (PyStopIterationObject*) whatever the exception value is and happily interpret an arbitrary memory position as PyObject*.
I attached a possible patch for the function. Another place to fix it would be in the yield-from code in ceval.c, but directly genobject.c seems the safer place. |
|
Date |
User |
Action |
Args |
2015-04-18 19:45:13 | scoder | set | recipients:
+ scoder |
2015-04-18 19:45:13 | scoder | set | messageid: <1429386313.82.0.910239252026.issue23996@psf.upfronthosting.co.za> |
2015-04-18 19:45:13 | scoder | link | issue23996 messages |
2015-04-18 19:45:13 | scoder | create | |
|