From bd2d80c1cc35e638b82d628f492273d08854d974 Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Sun, 3 Apr 2016 16:14:50 -0400 Subject: [PATCH] Check the return value of CheckTokenMembership() Signed-off-by: Selva Nair --- misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc.c b/misc.c index 29a53e6..1b62b3d 100644 --- a/misc.c +++ b/misc.c @@ -343,7 +343,8 @@ BOOL IsUserAdmin(VOID) &AdministratorsGroup); if(b) { - CheckTokenMembership(NULL, AdministratorsGroup, &b); + if (!CheckTokenMembership(NULL, AdministratorsGroup, &b)) + b = FALSE; FreeSid(AdministratorsGroup); }