[Lldb-commits] [lldb] r250953 - Fix lldb-server - write null terminating symbol along with port number.

Oleksiy Vyalov via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 21 14:58:22 PDT 2015


Author: ovyalov
Date: Wed Oct 21 16:58:22 2015
New Revision: 250953

URL: http://llvm.org/viewvc/llvm-project?rev=250953&view=rev
Log:
Fix lldb-server - write null terminating symbol along with port number.


Modified:
    lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=250953&r1=250952&r2=250953&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Wed Oct 21 16:58:22 2015
@@ -257,7 +257,7 @@ writeSocketIdToPipe(Pipe &port_pipe, con
 {
     size_t bytes_written = 0;
     // Write the port number as a C string with the NULL terminator.
-    return port_pipe.Write(socket_id.c_str(), socket_id.size(), bytes_written);
+    return port_pipe.Write(socket_id.c_str(), socket_id.size() + 1, bytes_written);
 }
 
 Error




More information about the lldb-commits mailing list