[PATCH 3/4] wineboot: Check GetTokenInformation() return value.

Serge Gautherie winehq-git_serge_180711 at gautherie.fr
Sun Jul 19 03:19:00 CDT 2020


Signed-off-by: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
---
 programs/wineboot/wineboot.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 21be0f5..1d8253e 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -1327,7 +1327,12 @@ static void update_user_profile(void)
         return;
 
     size = sizeof(token_buf);
-    GetTokenInformation(token, TokenUser, token_buf, size, &size);
+    if (!GetTokenInformation(token, TokenUser, token_buf, size, &size))
+    {
+        CloseHandle(token);
+        return;
+    }
+
     CloseHandle(token);
 
     ConvertSidToStringSidW(((TOKEN_USER *)token_buf)->User.Sid, &sid);
-- 
2.10.0.windows.1




More information about the wine-devel mailing list