bpo-25862: Fix several bugs in the _io module. (GH-8026) · pythoncapi/cpython@fdb5a50 · GitHub
Skip to content

Commit fdb5a50

Browse files
bpo-25862: Fix several bugs in the _io module. (pythonGH-8026)
They can be exposed when some C API calls fail due to lack of memory. * Failed Py_BuildValue() could cause an assertion error in the following TextIOWrapper.tell(). * input_chunk could be decrefed twice in TextIOWrapper.seek() after failed Py_BuildValue(). * initvalue could leak in StringIO.__getstate__() after failed PyDict_Copy().
1 parent 0cdf5f4 commit fdb5a50

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Modules/_io/stringio.c

Lines changed: 3 additions & 1 deletion

Modules/_io/textio.c

Lines changed: 14 additions & 7 deletions

0 commit comments

Comments
 (0)