Skip to content

pin_init_array_from_fn and pin_chain are not unwind-safe #136

@nbdd0121

Description

@nbdd0121

pin_init_array_from_fn is unsound as it does not drop already-initialized elements during unwind. Same for pin_chain.

The fix would be to use a guard type that frees elements on both panicking and erroring path rather than check if returned value is Err.

Metadata

Metadata

Assignees

No one assigned

    Labels

    soundnessRelated to soundness issues

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions