mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-30 19:31:07 +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:
@@ -141,6 +141,18 @@ rdcstr strip_extension(const rdcstr &path)
|
||||
return path.substr(0, offs);
|
||||
}
|
||||
|
||||
rdcstr strip_nonbasic(rdcstr &str)
|
||||
{
|
||||
for(char &c : str)
|
||||
{
|
||||
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' ||
|
||||
c == ' ')
|
||||
continue;
|
||||
|
||||
c = '_';
|
||||
}
|
||||
}
|
||||
|
||||
void split(const rdcstr &in, rdcarray<rdcstr> &out, const char sep)
|
||||
{
|
||||
if(in.empty())
|
||||
|
||||
Reference in New Issue
Block a user