Author: ion
Date: Fri Aug 25 05:04:44 2006
New Revision: 23698
URL: http://svn.reactos.org/svn/reactos?rev=23698&view=rev
Log:
- If SeCaptureSubjectContextEx is called without a process, at least NULL-initialize the context to catch dereferences of invalid pointers.
Modified:
trunk/reactos/ntoskrnl/se/semgr.c
Modified: trunk/reactos/ntoskrnl/se/semgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=23…
==============================================================================
--- trunk/reactos/ntoskrnl/se/semgr.c (original)
+++ trunk/reactos/ntoskrnl/se/semgr.c Fri Aug 25 05:04:44 2006
@@ -426,7 +426,13 @@
PAGED_CODE();
/* ROS HACK */
- if (!Process) return;
+ if (!Process)
+ {
+ SubjectContext->PrimaryToken = NULL;
+ SubjectContext->ProcessAuditId = 0;
+ SubjectContext->ClientToken = NULL;
+ return;
+ }
/* Save the unique ID */
SubjectContext->ProcessAuditId = Process->UniqueProcessId;