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

PyType_FromSpec may leak memory with repeated slot IDs #93466

Closed
Assignees
encukou
Labels
@encukou

Description

@encukou

If a slot ID is repeated inPyType_Spec, the currentPyType_FromSpec implementation happens tousually use the last one and ignore earlier ones, but:

  • ifPy_tp_doc is repeated,PyType_FromSpec may leak memory, and
  • ifPy_tp_members is repeated,PyType_FromSpec may memcpy unintialized memory (if slot specifies fewer members than the last one).

We chould:

  • clarify in the docs that repeated slot IDs are not supported
  • raise an exception for duplicate slots (at least when it's easy to detect, as in the cases above)

Alternatively, we could formalize that the last slot of a given ID “wins” and fix the leak/mem issue, but I don't see a use case for this more complex behavior.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp