Skip to content

AST: ensure kw_defaults is always allocated for kw-only args (fix NULL deref) #142462

@AZero13

Description

@AZero13

Bug report

Bug description:

has_kwonlydefaults can null-deref kw_defaults when the AST arguments node is constructed with kwonlyargs but a null kw_defaults.

CPython versions tested on:

3.15, CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions