[CSRSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 6 Jan 2013 00:05:09 +0000 (00:05 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 6 Jan 2013 00:05:09 +0000 (00:05 +0000)
Check for NULL parameter in the function CsrLocateThreadByClientId. Triggered when it was called by CsrApiHandleConnectionRequest during tests (the call to CsrLocateThreadByClientId happens in line 146 of api.c).

svn path=/branches/ros-csrss/; revision=58121

subsystems/win32/csrsrv/thredsup.c

index d7238d2..7363372 100644 (file)
@@ -188,6 +188,8 @@ CsrLocateThreadByClientId(OUT PCSR_PROCESS *Process OPTIONAL,
     PCSR_THREAD FoundThread;
     // ASSERT(ProcessStructureListLocked());
 
+    if (Process) *Process = NULL;
+
     /* Hash the Thread */
     i = CsrHashThread(ClientId->UniqueThread);
 
@@ -210,7 +212,7 @@ CsrLocateThreadByClientId(OUT PCSR_PROCESS *Process OPTIONAL,
              FoundThread->ClientId.UniqueThread  == ClientId->UniqueThread )
         {
             /* Match found, return the process */
-            *Process = FoundThread->Process;
+            if (Process) *Process = FoundThread->Process;
 
             /* Return thread too */
 //            DPRINT1("Found: %p %p\n", FoundThread, FoundThread->Process);