From 9967d9aa4ce982308d7d9c00a6677313a5c1c9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 30 Oct 2021 11:10:08 +0200 Subject: [PATCH] [NTOS:IO] Do not crash when calling IopLegacyResourceAllocation with NULL ResourceRequirements --- ntoskrnl/io/iomgr/iorsrce.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ntoskrnl/io/iomgr/iorsrce.c b/ntoskrnl/io/iomgr/iorsrce.c index 728832b1fca..d3e1abf3039 100644 --- a/ntoskrnl/io/iomgr/iorsrce.c +++ b/ntoskrnl/io/iomgr/iorsrce.c @@ -920,6 +920,15 @@ IopLegacyResourceAllocation(IN ARBITER_REQUEST_SOURCE AllocationType, DPRINT1("IopLegacyResourceAllocation is halfplemented!\n"); + if (!ResourceRequirements) + { + /* We can get there by calling IoAssignResources() with RequestedResources = NULL. + * TODO: not sure what we should do, but we shouldn't crash. + * */ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; + } + Status = IopFixupResourceListWithRequirements(ResourceRequirements, AllocatedResources); if (!NT_SUCCESS(Status))