Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

No description provided.

@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 2.7 labels Apr 14, 2017
@mention-bot
Copy link

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @freddrake, @loewis and @benjaminp to be potential reviewers.

@louisom
Copy link
Contributor

louisom commented Apr 17, 2017

@serhiy-storchaka May I ask a question? How did you found this bug, is via valgrind or something else? thanks.

@serhiy-storchaka
Copy link
Member Author

Just by reading a code. I searched unchecked usages of PyObject_Size()/PySequence_Size()/PyMapping_Size() for bpo-30061 and after finding few suspicious cases in parsermodule.c analyzed other code in that file.

Copy link
Contributor

@louisom louisom left a comment

Choose a reason for hiding this comment

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

A small question about ref

PyObject *err = Py_BuildValue("Os", tuple,
"Illegal component tuple.");
PyErr_SetObject(parser_error, err);
Py_XDECREF(err);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should tuple need Py_DECREF too? like what you done at line 950

Copy link
Member Author

Choose a reason for hiding this comment

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

No. tuple is a borrowed reference here (it's a parameter of build_node_tree()).

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I see. didn't notice this. Thanks for your explain!

@serhiy-storchaka serhiy-storchaka merged commit a79f4c2 into python:master Apr 19, 2017
@serhiy-storchaka serhiy-storchaka deleted the parsermodule-errors-handling branch April 19, 2017 18:09
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 19, 2017
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 19, 2017
serhiy-storchaka added a commit that referenced this pull request Apr 19, 2017
serhiy-storchaka added a commit that referenced this pull request Apr 19, 2017
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 19, 2017
…the parser module. (pythonGH-1131). (pythonGH-1185)

(cherry picked from commit a79f4c2).
(cherry picked from commit 952a05e)
serhiy-storchaka added a commit that referenced this pull request Apr 19, 2017
…the parser module. (GH-1131). (GH-1185) (#1189)

(cherry picked from commit a79f4c2).
(cherry picked from commit 952a05e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants