-
Notifications
You must be signed in to change notification settings - Fork 75
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
#[zeroize(drop)]
no-op in zeroize_derive v1.1 for enum
s
#876
Comments
This was referenced Sep 24, 2021
Confirmed via Input: #[derive(Zeroize)]
#[zeroize(drop)]
pub enum Foo {
A(u8),
B(u16),
C(u32)
}
#[allow(non_upper_case_globals)]
#[doc(hidden)]
const _DERIVE_zeroize_Zeroize_FOR_Foo: () = {
extern crate zeroize;
impl zeroize::Zeroize for Foo {
fn zeroize(&mut self) {
match self {
Foo::A(ref mut __binding_0) => {
__binding_0.zeroize();
}
Foo::B(ref mut __binding_0) => {
__binding_0.zeroize();
}
Foo::C(ref mut __binding_0) => {
__binding_0.zeroize();
}
}
}
}
}; zeroize_derive v1.2 output: #[allow(non_upper_case_globals)]
#[doc(hidden)]
const _DERIVE_zeroize_Zeroize_FOR_Foo: () = {
extern crate zeroize;
impl zeroize::Zeroize for Foo {
fn zeroize(&mut self) {
match self {
Foo::A(ref mut __binding_0) => {
__binding_0.zeroize();
}
Foo::B(ref mut __binding_0) => {
__binding_0.zeroize();
}
Foo::C(ref mut __binding_0) => {
__binding_0.zeroize();
}
}
}
}
};
#[doc(hidden)]
#[allow(non_upper_case_globals)]
const _DERIVE_Drop_FOR_Foo: () = {
impl Drop for Foo {
fn drop(&mut self) {
self.zeroize();
}
}
}; I have yanked all of the releases of |
Assigned RUSTSEC-2021-0115 |
This was referenced Oct 20, 2021
This was referenced Oct 19, 2022
RUSTSEC-2021-0115:
#[zeroize(drop)]
doesn't implement Drop
for enum
s
maidsafe/temp_safe_network#1673
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I discovered a bug where
#[zeroize(drop)]
doesn't generate aDrop
implementation when used onenum
s. It seems to me that it was accidentally fixed by #847 in zeroize_derive version 1.2. The bug still exists in version 1.1.If I'm not missing something and this bug is real, version 1.1 should probably be yanked and a report filed at the RustSec Advisory Database.
Cargo.toml
:lib.rs
:The text was updated successfully, but these errors were encountered: