[CSRSRV] Fix uninitialized variable warning detected by Clang. (#3619) 3619/head
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 21 Apr 2021 17:48:58 +0000 (19:48 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 5 May 2021 15:24:14 +0000 (17:24 +0200)
CORE-17545

subsystems/win32/csrsrv/api.c:63:9: warning: variable 'ServerDll' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
    if ((ServerId >= CSR_SERVER_DLL_MAX) ||
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subsystems/win32/csrsrv/api.c:67:76: note: uninitialized use occurs here
        DPRINT1("CSRSS: %lx is invalid ServerDllIndex (%08x)\n", ServerId, ServerDll);
                                                                           ^~~~~~~~~

subsystems/win32/csrsrv/api.c

index 39229a1..07b8db3 100644 (file)
@@ -52,7 +52,7 @@ CsrCallServerFromServer(IN PCSR_API_MESSAGE ReceiveMsg,
                         IN OUT PCSR_API_MESSAGE ReplyMsg)
 {
     ULONG ServerId;
-    PCSR_SERVER_DLL ServerDll;
+    PCSR_SERVER_DLL ServerDll = NULL;
     ULONG ApiId;
     CSR_REPLY_CODE ReplyCode = CsrReplyImmediately;