rust-pcap / pcap

Rust language pcap library
Apache License 2.0
620 stars 144 forks source link

Fix double close #125

Closed Trolldemorted closed 4 years ago

Trolldemorted commented 4 years ago

When file_out goes out of scope it closes fd_out, but it is also closed explicitly: https://github.com/ebfull/pcap/blob/1e878474fa35fc0cb796d248bf3e373482716a3b/tests/lib.rs#L244-L259

If the second closing happens after the call to Capture::from_raw_fd, the fd number was reused and the capture's file handle is being closed while it is still used.

Fixes #119

sekineh commented 4 years ago

I think it will fix the problem, but CI was canceled due to macosx nightly bug. I'm rerunning GitHub Actions jobs. -> Now the result is good!