-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-30070: Fixed leaks and crashes in errors handling in the parser module. #1131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()).
There was a problem hiding this comment.
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!
…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.