diff options
author | Sylvestre Ledru <sylvestre@debian.org> | 2013-09-28 15:23:41 +0000 |
---|---|---|
committer | Sylvestre Ledru <sylvestre@debian.org> | 2013-09-28 15:23:41 +0000 |
commit | d28b99374f174cc2da6657c876ab4f350e6e0fba (patch) | |
tree | 6b2ffc5b4c296b41d91b35fbc35c0dd1d8a72eaf /lldb/source | |
parent | 602623f9aefe9c429c3a1dafe4be6ea1d3ce17a4 (diff) | |
download | bcm5719-llvm-d28b99374f174cc2da6657c876ab4f350e6e0fba.tar.gz bcm5719-llvm-d28b99374f174cc2da6657c876ab4f350e6e0fba.zip |
* mktemp is insecure as it always creates or uses insecure temporary file.
Switch to mkstemp.
* Get and display the error message when an error occurs while creating the temporary file
llvm-svn: 191616
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index dd161395601..47223f14575 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include <errno.h> #include "GDBRemoteCommunicationServer.h" #include "lldb/Core/StreamGDBRemote.h" @@ -762,9 +763,9 @@ GDBRemoteCommunicationServer::Handle_qLaunchGDBServer (StringExtractorGDBRemote Error error; std::string hostname; char unix_socket_name[PATH_MAX] = "/tmp/XXXXXX"; - if (::mktemp (unix_socket_name) == NULL) + if (::mkstemp (unix_socket_name) == -1) { - error.SetErrorString ("failed to make temporary path for a unix socket"); + error.SetErrorStringWithFormat("failed to make temporary path for a unix socket with errno: %s", strerror(errno)); } else { |