Skip to content

Commit

Permalink
fix sockaddr_un length calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Jan 12, 2024
1 parent e0cfbc0 commit 6b8f3ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/IORingUtils/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ extension sockaddr_un: SocketAddress, @unchecked Sendable {

try withUnsafeMutablePointer(to: &sun.sun_path) { path in
let start = path.propertyBasePointer(to: \.0)!
let capacity = MemoryLayout.size(ofValue: path)
let capacity = MemoryLayout.size(ofValue: path.pointee)
if capacity <= presentationAddress.utf8.count {
throw Errno.outOfRange
}
Expand Down

0 comments on commit 6b8f3ce

Please sign in to comment.