diff options
Diffstat (limited to 'doh/tests/doh_frontend/src/dns_https_frontend.rs')
-rw-r--r-- | doh/tests/doh_frontend/src/dns_https_frontend.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doh/tests/doh_frontend/src/dns_https_frontend.rs b/doh/tests/doh_frontend/src/dns_https_frontend.rs index b7d11b7d..d3c538d4 100644 --- a/doh/tests/doh_frontend/src/dns_https_frontend.rs +++ b/doh/tests/doh_frontend/src/dns_https_frontend.rs @@ -477,6 +477,9 @@ fn into_tokio_udp_socket(socket: std::net::UdpSocket) -> Result<UdpSocket> { fn build_pipe() -> Result<(File, File)> { let mut fds = [0, 0]; + // SAFETY: The pointer we pass to `pipe` must be valid because it comes from a reference. The + // file descriptors it returns must be valid and open, so they are safe to pass to + // `File::from_raw_fd`. unsafe { if libc::pipe(fds.as_mut_ptr()) == 0 { return Ok((File::from_raw_fd(fds[0]), File::from_raw_fd(fds[1]))); |