Skip to content

tweens::linear is unsound #723

Open
@MaxVerevkin

Description

@MaxVerevkin

The following code segfaults:

struct Node {
    b: Box<u8>,
    c: Box<u8>,
}
impl scene::Node for Node {}
let node = scene::add_node(Node {
    b: Box::new(0),
    c: Box::new(0),
});
tweens::linear(
    node,
    |node| {
        dbg!(&node.b);
        dbg!(&node.c);
        todo!()
    },
    0.0,
    1.0,
    1.0,
);

The lens callback receives a mutable reference pointing to uninitialized memory, which is immediate UB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions