From 5f13171411d531d15105048de2efc69407bd2028 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 18 Aug 2011 18:35:03 +0000 Subject: [PATCH] [NTOSKRNL] - Implement a special case copy-in for IRP_MN_FILTER_RESOURCE_REQUIREMENTS to prevent NULL pointer access in function drivers svn path=/trunk/; revision=53304 --- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index d3b664ebc7d..f8bb18b478d 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -885,6 +885,14 @@ IopSynchronousCall(IN PDEVICE_OBJECT DeviceObject, Irp->IoStatus.Status = IoStatusBlock.Status = STATUS_NOT_SUPPORTED; Irp->IoStatus.Information = IoStatusBlock.Information = 0; + /* Special case for IRP_MN_FILTER_RESOURCE_REQUIREMENTS */ + if (IoStackLocation->MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS) + { + /* Copy the resource requirements list into the IOSB */ + Irp->IoStatus.Information = + IoStatusBlock.Information = (ULONG_PTR)IoStackLocation->Parameters.FilterResourceRequirements.IoResourceRequirementList; + } + /* Initialize the event */ KeInitializeEvent(&Event, SynchronizationEvent, FALSE);