Add an error message and don't add child process for invalid ident

This commit is contained in:
baldurk
2020-10-26 10:24:40 +00:00
parent 985ce847e4
commit 117e16041a
2 changed files with 10 additions and 0 deletions
+7
View File
@@ -1726,6 +1726,13 @@ void RenderDoc::FinishCaptureWriting(RDCFile *rdc, uint32_t frameNumber)
void RenderDoc::AddChildProcess(uint32_t pid, uint32_t ident)
{
if(ident == 0 || ident == m_RemoteIdent)
{
RDCERR("Child process %u returned invalid ident %u. Possibly too many listen sockets in use!",
pid, ident);
return;
}
SCOPED_LOCK(m_ChildLock);
m_Children.push_back(make_rdcpair(pid, ident));
}
+3
View File
@@ -146,6 +146,9 @@ __attribute__((visibility("default"))) pid_t fork()
usleep(1000);
}
if(ident == ownIdent)
ident = 0;
RDCLOG("PID %u has ident %u", ret, ident);
RenderDoc::Inst().AddChildProcess((uint32_t)ret, (uint32_t)ident);