 
         var addr = sockaddr_un()
         addr.sun_family = sa_family_t(NIOBSDSocket.AddressFamily.unix.rawValue)
-        pathBytes.withUnsafeBufferPointer { srcPtr in
-            withUnsafeMutablePointer(to: &addr.sun_path) { dstPtr in
-                dstPtr.withMemoryRebound(to: UInt8.self, capacity: pathBytes.count) { dstPtr in
-                    dstPtr.assign(from: srcPtr.baseAddress!, count: pathBytes.count)
-                }
+
+        pathBytes.withUnsafeBytes { srcBuffer in
+            withUnsafeMutableBytes(of: &addr.sun_path) { dstPtr in
+                dstPtr.copyMemory(from: srcBuffer)
             }
         }
 


            let bufferSize = MemoryLayout.size(ofValue: addr1.address.sun_path)

            // These uses of withMemoryRebound(to:) are fine: the `strncmp` call cannot possibly re-enter Swift code, and so we cannot possibly violate
            // Swift's strict aliasing rules by way of this type-pun.
            return withUnsafePointer(to: addr1.address.sun_path) { sunpath1 in
                return withUnsafePointer(to: addr2.address.sun_path) { sunpath2 in
                    return sunpath1.withMemoryRebound(to: Int8.self, capacity: bufferSize) { sunpath1 in
                        return sunpath2.withMemoryRebound(to: Int8.self, capacity: bufferSize) { sunpath2 in
                            return strncmp(sunpath1, sunpath2, MemoryLayout.size(ofValue: bufferSize)) == 0
                        }
                    }
                }
            }
        case (.v4, _), (.v6, _), (.unixDomainSocket, _):


            port = "\(self.port!)"
        case .unixDomainSocket(let addr):
            let address = addr.address
            host = nil
            type = "UDS"
            addressString = ""

            // This is a static assert that exists just to verify the safety of the assumption below.
            assert(Swift.type(of: address.sun_path.0) == CChar.self)
            port = withUnsafePointer(to: address.sun_path) { ptr in
                // Homogeneous tuples are always implicitly also bound to their element type, so this assumption below is safe.
                let charPtr = UnsafeRawPointer(ptr).assumingMemoryBound(to: CChar.self)
                return String(cString: charPtr)
            }
            return "[\(type)]\(port)"
        }
