Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 30, 2018

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().
    (cherry picked from commit fdb5a50)

https://bugs.python.org/issue25862

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()..
(cherry picked from commit fdb5a50)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error skip news labels Jun 30, 2018
@bedevere-bot bedevere-bot added the type-bug An unexpected behavior, bug, or error label Jun 30, 2018
Py_DECREF(next_input);
goto fail;
}
PyObject *snapshot = Py_BuildValue("NN", dec_flags, next_input);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declaring snapshot at the top of the block will likely fix the AppVeyor build.

@serhiy-storchaka serhiy-storchaka merged commit eab421b into python:2.7 Dec 4, 2018
@serhiy-storchaka serhiy-storchaka deleted the backport-fdb5a50-2.7 branch December 4, 2018 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants