Added Try+Except block for ProbeForRead
Possible security problem under double-fetch conditions. Microsoft says all ProbeForRead calls should be treated as if they could throw exceptions.  SRC:
@@ -634,9 +634,15 @@ NTSTATUS NeoNdisDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp)
{
MmProbeAndLockPages(mdl, KernelMode, IoReadAccess);
}
-
+ __try
+ {
ProbeForRead(buf, NEO_EXCHANGE_BUFFER_SIZE, 1);
-
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER)
+ {
+ check_ok = false;
+ }
+ if (check_ok) {
// Write
NeoWrite(buf);
Irp->IoStatus.Information = stack->Parameters.Write.Length;
@@ -651,6 +657,7 @@ NTSTATUS NeoNdisDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp)
}
}
}
+ }
if (ok == FALSE)
{
// An error occurred
