While conducting an internal unsafe review, we identified a possible soundness issue in JobPort::Drop
|
unsafe { CloseHandle(self.completion_port) }; |
This is highly suspect when combined with #[derive(Clone)] on the struct: any use of Clone is likely to lead to a double-free. This will usually produce a harmless "invalid handle" error which this code will silently ignore, but if either HANDLE value is reused by the kernel before the second clone is dropped, undefined behavior seems possible.
While conducting an internal unsafe review, we identified a possible soundness issue in
JobPort::Dropcommand-group/src/winres.rs
Line 35 in b88296f
This is highly suspect when combined with
#[derive(Clone)]on the struct: any use of Clone is likely to lead to a double-free. This will usually produce a harmless "invalid handle" error which this code will silently ignore, but if either HANDLE value is reused by the kernel before the second clone is dropped, undefined behavior seems possible.