Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Unix.getsockname and unnamed PF_UNIX sockets #7039
Original bug ID: 7039
When applied to an unnamed socket of the PF_UNIX family, Unix.getsockname returns ADDR_UNIX of a string containing random junk. This is because the sun_path field of the sockaddr_un structure is not initialized in the case of an unnamed socket. Reading a zero-terminated string off of sun_path, then, produces garbage and could cause a memory fault (if no zero byte is found nearby).
Steps to reproduce
See attached repro.