[2.7] bpo-25862: Fix several bugs in the _io module. (GH-8026)#8033
Merged
serhiy-storchaka merged 3 commits intoDec 4, 2018
Conversation
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 <storchaka@gmail.com>
ZackerySpytz
reviewed
Jul 9, 2018
| Py_DECREF(next_input); | ||
| goto fail; | ||
| } | ||
| PyObject *snapshot = Py_BuildValue("NN", dec_flags, next_input); |
Contributor
There was a problem hiding this comment.
Declaring snapshot at the top of the block will likely fix the AppVeyor build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They can be exposed when some C API calls fail due to lack of
memory.
following TextIOWrapper.tell().
after failed Py_BuildValue().
PyDict_Copy().
(cherry picked from commit fdb5a50)
https://bugs.python.org/issue25862