[NTOSKRNL]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 27 Jun 2010 20:13:44 +0000 (20:13 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 27 Jun 2010 20:13:44 +0000 (20:13 +0000)
NtDuplicateToken: Fail, if TokenType is neither TokenImpersonation nor TokenPrimary.

svn path=/trunk/; revision=47868

reactos/ntoskrnl/se/token.c

index 6ee5254..703a99a 100644 (file)
@@ -1811,6 +1811,10 @@ NtDuplicateToken(IN HANDLE ExistingTokenHandle,
 
     PAGED_CODE();
 
 
     PAGED_CODE();
 
+    if (TokenType != TokenImpersonation &&
+        TokenType != TokenPrimary)
+        return STATUS_INVALID_PARAMETER;
+
     PreviousMode = KeGetPreviousMode();
 
     if (PreviousMode != KernelMode)
     PreviousMode = KeGetPreviousMode();
 
     if (PreviousMode != KernelMode)