Skip to content

MethodDescriptor2_new does not check for NULL in _testcapi #121791

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

Closed
sobolevn opened this issue Jul 15, 2024 · 0 comments
Closed

MethodDescriptor2_new does not check for NULL in _testcapi #121791

sobolevn opened this issue Jul 15, 2024 · 0 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jul 15, 2024

Bug report

Here:

static PyObject *
MethodDescriptor2_new(PyTypeObject* type, PyObject* args, PyObject *kw)
{
MethodDescriptor2Object *op = PyObject_New(MethodDescriptor2Object, type);
op->base.vectorcall = NULL;
op->vectorcall = MethodDescriptor_vectorcall;
return (PyObject *)op;
}

I know that memory errors are very unluckily, but still: why not having a correct code?

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Jul 15, 2024
@sobolevn sobolevn self-assigned this Jul 15, 2024
sobolevn added a commit to sobolevn/cpython that referenced this issue Jul 15, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 16, 2024
…tcapi` (pythonGH-121792)

(cherry picked from commit 8b6d475)

Co-authored-by: sobolevn <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 16, 2024
…tcapi` (pythonGH-121792)

(cherry picked from commit 8b6d475)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue Jul 16, 2024
…stcapi` (GH-121792) (#121840)

gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (GH-121792)
(cherry picked from commit 8b6d475)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue Jul 16, 2024
…stcapi` (GH-121792) (#121839)

gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (GH-121792)
(cherry picked from commit 8b6d475)

Co-authored-by: sobolevn <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant