[CONSRV] Fix uninitialized variables warnings detected by Clang. (#3619)

CORE-17545

Fix 3 warnings:

win32ss/user/winsrv/consrv/alias.c:648:16: warning: variable 'Status' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (CurEntry)
               ^~~~~~~~
win32ss/user/winsrv/consrv/alias.c:693:12: note: uninitialized use occurs here
    return Status;
           ^~~~~~

win32ss/user/winsrv/consrv/alias.c:715:9: warning: variable 'Status' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (Header)
        ^~~~~~
win32ss/user/winsrv/consrv/alias.c:727:12: note: uninitialized use occurs here
    return Status;
           ^~~~~~

win32ss/user/winsrv/consrv/alias.c:771:16: warning: variable 'Status' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (RootHeader)
               ^~~~~~~~~~
win32ss/user/winsrv/consrv/alias.c:807:12: note: uninitialized use occurs here
    return Status;
This commit is contained in:
Hermès Bélusca-Maïto 2021-04-21 18:45:35 +02:00
parent ab8d7f2548
commit 9a93d2fe3a
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -594,7 +594,7 @@ CON_API(SrvGetConsoleAlias,
CON_API(SrvGetConsoleAliases,
CONSOLE_GETALLALIASES, GetAllAliasesRequest)
{
NTSTATUS Status;
NTSTATUS Status = STATUS_SUCCESS;
ULONG BytesWritten = 0;
PALIAS_HEADER Header;
@ -697,7 +697,7 @@ Quit:
CON_API(SrvGetConsoleAliasesLength,
CONSOLE_GETALLALIASESLENGTH, GetAllAliasesLengthRequest)
{
NTSTATUS Status;
NTSTATUS Status = STATUS_SUCCESS;
PALIAS_HEADER Header;
if (!CsrValidateMessageBuffer(ApiMessage,
@ -731,7 +731,7 @@ CON_API(SrvGetConsoleAliasesLength,
CON_API(SrvGetConsoleAliasExes,
CONSOLE_GETALIASESEXES, GetAliasesExesRequest)
{
NTSTATUS Status;
NTSTATUS Status = STATUS_SUCCESS;
UINT BytesWritten = 0;
if (!CsrValidateMessageBuffer(ApiMessage,