https://git.reactos.org/?p=reactos.git;a=commitdiff;h=41e7c818d1c7045fe2f0d…
commit 41e7c818d1c7045fe2f0d9af8a55102fde17018a
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue Jun 11 22:29:34 2019 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Jun 11 22:29:34 2019 +0200
[NTOS] IoSetHardErrorOrVerifyDevice(): Check whether the IRP is not associated with
any thread.
---
ntoskrnl/io/iomgr/util.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ntoskrnl/io/iomgr/util.c b/ntoskrnl/io/iomgr/util.c
index bd7fdde85dc..95a211d1594 100644
--- a/ntoskrnl/io/iomgr/util.c
+++ b/ntoskrnl/io/iomgr/util.c
@@ -316,6 +316,14 @@ NTAPI
IoSetHardErrorOrVerifyDevice(IN PIRP Irp,
IN PDEVICE_OBJECT DeviceObject)
{
+ /* Ignore in case the IRP is not associated with any thread */
+ if (!Irp->Tail.Overlay.Thread)
+ {
+ DPRINT1("IoSetHardErrorOrVerifyDevice(0x%p, 0x%p): IRP has no thread,
ignoring.\n"
+ Irp, DeviceObject);
+ return;
+ }
+
/* Set the pointer in the IRP */
Irp->Tail.Overlay.Thread->DeviceToVerify = DeviceObject;
}