Skip to content

Release 0.7.7

Compare
Choose a tag to compare
@meithecatte meithecatte released this 17 Apr 00:19
· 21 commits to master since this release
687709f

This release fixes a soundness issue in the make_bitflags! macro. Previously, code like this was accepted:

#[bitflags]
#[repr(u8)]
#[derive(Copy, Clone, Debug)]
enum Test {
    A = 1,
    B = 2,
}

impl Test {
    const C: u8 = 69;
}

fn main() {
    let x = make_bitflags!(Test::{C});
}

Iterating over x would then create values of Test with bit patterns that don't correspond to any of the variants, which is undefined behavior.

This bug has been introduced in 0.7.0, together with the make_bitflags! macro itself.

I don't think it is likely that this was actually present in anyone's code, but in an abundance of caution, I have yanked all affected versions.

This issue has been assigned RUSTSEC-2023-0035.