diff --git a/reactos/ntoskrnl/ps/security.c b/reactos/ntoskrnl/ps/security.c index ceb60f44d94..b706cb2f801 100644 --- a/reactos/ntoskrnl/ps/security.c +++ b/reactos/ntoskrnl/ps/security.c @@ -263,6 +263,7 @@ PspSetPrimaryToken(IN PEPROCESS Process, SubjectContext.ClientToken = NULL; /* Do the access check */ + if (!SecurityDescriptor) DPRINT1("FIX PS SDs!!\n"); Result = SeAccessCheck(SecurityDescriptor, &SubjectContext, FALSE, diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c index e574518f3c5..f171e2aac82 100644 --- a/reactos/ntoskrnl/se/semgr.c +++ b/reactos/ntoskrnl/se/semgr.c @@ -871,6 +871,14 @@ SeAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, PAGED_CODE(); + /* Check if we didn't get an SD */ + if (!SecurityDescriptor) + { + /* Automatic failure */ + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } + CurrentAccess = PreviouslyGrantedAccess; if (SubjectContextLocked == FALSE)