[PATCH 2/2] ntoskrnl.exe: Don't try to copy back data in buffered mode when we don't expect any in process_ioctl.
Christian Costa
titan.costa at gmail.com
Wed Oct 3 01:55:14 CDT 2012
In that cas out_buff is NULL. The driver don't even update out data size (irp.IoStatus.Information) in my case.
---
dlls/ntoskrnl.exe/ntoskrnl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 3c5dd62..8481e2b 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -197,7 +197,8 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
*out_size = (irp.IoStatus.u.Status >= 0) ? irp.IoStatus.Information : 0;
if ((code & 3) == METHOD_BUFFERED)
{
- memcpy( out_buff, irp.AssociatedIrp.SystemBuffer, *out_size );
+ if (out_buff)
+ memcpy( out_buff, irp.AssociatedIrp.SystemBuffer, *out_size );
HeapFree( GetProcessHeap(), 0, irp.AssociatedIrp.SystemBuffer );
}
return irp.IoStatus.u.Status;
More information about the wine-patches
mailing list