mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user