Skip to content

Ensure that BLAKE-2 objects are fully initialized before being GC-tracked #155830

Description

@picnixz

Bug report

Bug description:

The BLAKE-2 internal states are initialized after PyObject_GC_Track is called. If unlucky, we would call py_blake2_clear on uninitialized states since PyObject_GC_New is used (we want to first initialize the objects entirely before tracking them but some fields depend on the type so we can't use zeroing as is).

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions