Hi, I am scanning this crate in the latest version using my own static analyzer tool.
Unsafe pointer conversion is found at: src/message.rs:119
pub fn append<T>(msg: &mut NetlinkMessage, data: &T, len: u32, pad: i32) -> i32 {
unsafe {
let vptr: *const c_void = mem::transmute(data);
nlmsg_append(msg.ptr, vptr, len as size_t, pad as c_int) as i32
}
}
This unsound implementation would create memory issues such as overflow, underflow, or misalignment, since the type T is converted to c_void (1 byte, 8 bits). The attacker can manipulate the argument len associated with the c_void pointer with large value, which can lead to buffer overflow bug. This can further corrupt the C/C++ code.
This would cause undefined behaviors in Rust. I am reporting this issue for your attention.
Hi, I am scanning this crate in the latest version using my own static analyzer tool.
Unsafe pointer conversion is found at: src/message.rs:119
This unsound implementation would create memory issues such as overflow, underflow, or misalignment, since the type
Tis converted toc_void(1 byte, 8 bits). The attacker can manipulate the argumentlenassociated with thec_voidpointer with large value, which can lead to buffer overflow bug. This can further corrupt the C/C++ code.This would cause undefined behaviors in Rust. I am reporting this issue for your attention.