[NTOS]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 20 Mar 2010 22:05:01 +0000 (22:05 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 20 Mar 2010 22:05:01 +0000 (22:05 +0000)
NtOpenThreadTokenEx: Initialize NewToken with NULL, so it doesn't get wrongly dereferenced. Fixes advapi32:security winetest crash.

svn path=/trunk/; revision=46289

reactos/ntoskrnl/se/token.c

index c27d7f8..44481d6 100644 (file)
@@ -2187,7 +2187,7 @@ NtOpenThreadTokenEx(IN HANDLE ThreadHandle,
 {
     PETHREAD Thread, NewThread;
     HANDLE hToken;
-    PTOKEN Token, NewToken, PrimaryToken;
+    PTOKEN Token, NewToken = NULL, PrimaryToken;
     BOOLEAN CopyOnOpen, EffectiveOnly;
     SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
     SE_IMPERSONATION_STATE ImpersonationState;
@@ -2313,9 +2313,9 @@ NtOpenThreadTokenEx(IN HANDLE ThreadHandle,
     }
     
     if (NewToken) ObDereferenceObject(NewToken);
-    
+
     if (CopyOnOpen && NewThread) ObDereferenceObject(NewThread);
-        
+
     if(NT_SUCCESS(Status))
     {
         _SEH2_TRY