Sanitise strings printed when received from target control/remote server

* Given socket corruption or network errors these strings could contain
  unprintable characters so we sanitise them reasonably. This also ameliorates a
  potential security concern with arbitrary strings being written to a log, but
  these connections are still considered trusted and users should not be
  exposing RenderDoc ports to the internet.
This commit is contained in:
baldurk
2023-05-19 10:28:58 +01:00
parent e0464fea4f
commit 1f72a09e3b
5 changed files with 47 additions and 12 deletions
+11
View File
@@ -473,6 +473,17 @@ void rdclog_direct(time_t utcTime, uint32_t pid, LogType type, const char *proje
va_end(args2);
}
// normalise newlines
{
char *nl = base;
while(*nl)
{
if(*nl == '\r')
*nl = '\n';
nl++;
}
}
// likely path - string contains no newlines
char *nl = strchr(base, '\n');
if(nl == NULL)