Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweens::linear is unsound #723

Open
MaxVerevkin opened this issue May 12, 2024 · 0 comments · May be fixed by #798
Open

tweens::linear is unsound #723

MaxVerevkin opened this issue May 12, 2024 · 0 comments · May be fixed by #798

Comments

@MaxVerevkin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant