Skip to content

create_surfaces is unsound #16683

@spectria-limina

Description

@spectria-limina

Bevy version

0.15

What went wrong

In create_surfaces, the underlying create_surface_unsafe is called under the assumption that any surface target inside of ExtractedWindows is guaranteed to be valid.

This isn't true, however. The fields on RawHandleWrapper are public, so any user could insert garbage data and cause the call to create_surface_unsafe to use invalid data.

Propose solution

Make RawHandleWrapper's fields private, replacing them with accessors and unsafe constructors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesD-UnsafeTouches with unsafe code in some wayP-UnsoundA bug that results in undefined compiler behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions