diff --git a/reactos/ntoskrnl/lpc/reply.c b/reactos/ntoskrnl/lpc/reply.c index ae42bb28c44..1aeba6e9acf 100644 --- a/reactos/ntoskrnl/lpc/reply.c +++ b/reactos/ntoskrnl/lpc/reply.c @@ -263,6 +263,12 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle, Request = EiDequeueMessagePort(Port); KeReleaseSpinLock(&Port->Lock, oldIrql); + if (Request == NULL) + { + ObDereferenceObject(Port); + return STATUS_UNSUCCESSFUL; + } + if (Request->Message.u2.s2.Type == LPC_CONNECTION_REQUEST) { PORT_MESSAGE Header;