From c9e27be585582bf3ae8d5831a669c640f0d6aaef Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Fri, 31 May 2019 05:06:54 +0000 Subject: [PATCH] Fix off-by-one error. The created string is one char too large, so it pulls the terminating NULL as the last character of the string. This later causes SocketTest.cpp to fail. llvm-svn: 362192 --- lldb/source/Host/posix/DomainSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp index f4b5f428742b..2710213efde2 100644 --- a/lldb/source/Host/posix/DomainSocket.cpp +++ b/lldb/source/Host/posix/DomainSocket.cpp @@ -136,7 +136,7 @@ std::string DomainSocket::GetSocketName() const { return std::string(saddr_un.sun_path + GetNameOffset(), sock_addr_len - offsetof(struct sockaddr_un, sun_path) - - GetNameOffset()); + GetNameOffset() - 1); } return ""; } -- 2.34.1