bpo-30070: Fixed leaks and crashes in errors handling in the parser module.#1131
Conversation
|
@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. |
|
@serhiy-storchaka May I ask a question? How did you found this bug, is via valgrind or something else? thanks. |
|
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 |
louisom
left a comment
There was a problem hiding this comment.
A small question about ref
| PyObject *err = Py_BuildValue("Os", tuple, | ||
| "Illegal component tuple."); | ||
| PyErr_SetObject(parser_error, err); | ||
| Py_XDECREF(err); |
There was a problem hiding this comment.
Should tuple need Py_DECREF too? like what you done at line 950
There was a problem hiding this comment.
No. tuple is a borrowed reference here (it's a parameter of build_node_tree()).
There was a problem hiding this comment.
ah, I see. didn't notice this. Thanks for your explain!
…rser module. (pythonGH-1131). (cherry picked from commit a79f4c2)
…rser module. (pythonGH-1131). (cherry picked from commit a79f4c2)
…the parser module. (pythonGH-1131). (pythonGH-1185) (cherry picked from commit a79f4c2). (cherry picked from commit 952a05e)
No description provided.