Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Some object-to-AST conversions are missing error checks #105588

Closed
Assignees
brandtbucher
Labels
3.11only security fixes3.12only security fixes3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)triagedThe issue has been accepted as valid by a triager.type-crashA hard crash of the interpreter, possibly with a core dump
@brandtbucher

Description

@brandtbucher

The generated code inPython-ast.c is missing error checks following the construction of C-levelalias,arg,comprehension,keyword,match_item, andwithitem nodes from their Python object counterparts. This means it's possible to crash the interpreter by attempting to compile an AST where a required member of these nodes is replaced withNone:

>>>importast>>>tree=ast.parse("""... match ...:...     case THIS:...         ...... """)>>>tree.body[0].cases[0].pattern=None>>>compile(tree,"<crash>","exec")Segmentationfault

I'll have a PR up in a minute with the one-line fix.

Linked PRs

Metadata

Metadata

Assignees

Labels

3.11only security fixes3.12only security fixes3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)triagedThe issue has been accepted as valid by a triager.type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp