Author: tfaber Date: Fri May 1 10:49:50 2015 New Revision: 67485
URL: http://svn.reactos.org/svn/reactos?rev=67485&view=rev Log: [NTOS:IO] - Add missing SEH around user buffer access in IopCompleteRequest - Remove a redundant condition CORE-9624
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Fri May 1 10:49:50 2015 @@ -284,10 +284,18 @@ (Irp->IoStatus.Status != STATUS_VERIFY_REQUIRED) && !(NT_ERROR(Irp->IoStatus.Status))) { - /* Copy the buffer back to the user */ - RtlCopyMemory(Irp->UserBuffer, - Irp->AssociatedIrp.SystemBuffer, - Irp->IoStatus.Information); + _SEH2_TRY + { + /* Copy the buffer back to the user */ + RtlCopyMemory(Irp->UserBuffer, + Irp->AssociatedIrp.SystemBuffer, + Irp->IoStatus.Information); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Do nothing */ + } + _SEH2_END; }
/* Also check if we should de-allocate it */ @@ -317,10 +325,9 @@ * (but warnings are OK!), or if it was completed with an error, but * did return from a pending I/O Operation and is not synchronous. */ - if (!(NT_ERROR(Irp->IoStatus.Status)) || - (NT_ERROR(Irp->IoStatus.Status) && - (Irp->PendingReturned) && - !(IsIrpSynchronous(Irp, FileObject)))) + if (!NT_ERROR(Irp->IoStatus.Status) || + (Irp->PendingReturned && + !IsIrpSynchronous(Irp, FileObject))) { /* Get any information we need from the FO before we kill it */ if ((FileObject) && (FileObject->CompletionContext))