[Lldb-commits] [PATCH] Added Connection::GetURI()

Greg Clayton clayborg at gmail.com
Fri Jan 16 17:35:43 PST 2015


We can avoid using snprintf and having to try and guess buffer sizes by using StreamString:

so this:

  char uri[280]; // sizeof(uri) > strlen("connect://") + 255 + strlen(1) + strlen("65535") + 1
  snprintf(uri, sizeof(uri), "connect://%s:%u",socket->GetRemoteIPAddress().c_str(), socket->GetRemotePortNumber());
  m_uri.assign(uri);

becomes:

  StreamString strm;
  strm.Printf("connect://%s:%u",socket->GetRemoteIPAddress().c_str(), socket->GetRemotePortNumber());
  m_uri.swap(strm.GetString());

Fix that and you are good to go.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7026

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list