[all-commits] [llvm/llvm-project] 5685eb: [lldb] Fix DomainSocket::GetSocketName for unnamed...

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Sep 23 03:32:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5685eb950da7c6901c8b264a3c93e8ea63b34d3d
      https://github.com/llvm/llvm-project/commit/5685eb950da7c6901c8b264a3c93e8ea63b34d3d
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M lldb/source/Host/posix/DomainSocket.cpp
    M lldb/unittests/Host/SocketTest.cpp

  Log Message:
  -----------
  [lldb] Fix DomainSocket::GetSocketName for unnamed sockets

getpeername will return addrlen = 2 (sizeof sa_family_t) for unnamed
sockets (those not assigned a name with bind(2)). This is typically true
for client sockets as well as those created by socketpair(2).

This GetSocketName used to crash for sockets which were connected to
these kinds of sockets. Now it returns an empty string.




More information about the All-commits mailing list