Skip to content
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

gh-101967: add a missing error check #101968

Merged
merged 5 commits into from Feb 18, 2023
Merged

Conversation

Eclips4
Copy link
Contributor

@Eclips4 Eclips4 commented Feb 16, 2023

Resolves #101967
According to the semantics of function, I prefered to return 1 instead of NULL. Does it correct?

@Eclips4 Eclips4 changed the title ceval.c: Fix possible segfault in positional_only_passed_as_keyword function gh-101967: ceval.c Fix possible segfault in positional_only_passed_as_keyword function Feb 16, 2023
@carljm carljm changed the title gh-101967: ceval.c Fix possible segfault in positional_only_passed_as_keyword function gh-101967: Fix possible segfault in positional_only_passed_as_keyword function Feb 16, 2023
carljm
carljm approved these changes Feb 16, 2023
@arhadthedev arhadthedev added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 17, 2023
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Yes, NULL can be returned by PyList_New when there's no memory left.

I don't think that we need to test this case.

Python/ceval.c Outdated Show resolved Hide resolved
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Python/ceval.c Outdated Show resolved Hide resolved
@iritkatriel iritkatriel changed the title gh-101967: Fix possible segfault in positional_only_passed_as_keyword function gh-101967: add a missing error check Feb 18, 2023
@iritkatriel
Copy link
Member

The MacOS build failure is unrelated.

@iritkatriel iritkatriel merged commit 89413bb into python:main Feb 18, 2023
16 of 17 checks passed
@miss-islington
Copy link
Contributor

Thanks @Eclips4 for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 18, 2023
(cherry picked from commit 89413bbccb9261b72190e275eefe4b0d49671477)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
@bedevere-bot
Copy link

GH-102016 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 18, 2023
(cherry picked from commit 89413bb)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Feb 18, 2023
(cherry picked from commit 89413bb)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
@Eclips4 Eclips4 deleted the issue-101967 branch February 18, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) needs backport to 3.11 type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ceval.c: positional_only_passed_as_keyword can be failed with segfault
7 participants