Fix double-fetch from user space.

This commit is contained in:
typpos 2021-02-15 19:18:41 +11:00
parent f452bfbbf6
commit f90eae89db
1 changed files with 3 additions and 2 deletions

View File

@ -504,7 +504,8 @@ _FX NTSTATUS Session_Api_DisableForce(PROCESS *proc, ULONG64 *parms)
in_flag = args->set_flag.val;
if (in_flag) {
ProbeForRead(in_flag, sizeof(ULONG), sizeof(ULONG));
if (*in_flag) {
ULONG in_flag_value = *in_flag;
if (in_flag_value) {
if (! Session_CheckAdminAccess(L"ForceDisableAdminOnly"))
return STATUS_ACCESS_DENIED;
@ -513,7 +514,7 @@ _FX NTSTATUS Session_Api_DisableForce(PROCESS *proc, ULONG64 *parms)
} else
time.QuadPart = 0;
if (*in_flag == DISABLE_JUST_THIS_PROCESS) {
if (in_flag_value == DISABLE_JUST_THIS_PROCESS) {
Process_DfpInsert(PROCESS_TERMINATED, PsGetCurrentProcessId());